@reacteditor/core 0.0.14 → 0.0.16
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/{chunk-IFFNAAXW.mjs → chunk-3NSI5XES.mjs} +262 -255
- package/dist/index.css +193 -247
- package/dist/index.js +274 -268
- package/dist/index.mjs +1 -1
- package/dist/no-external.css +193 -247
- package/dist/no-external.js +274 -268
- package/dist/no-external.mjs +1 -1
- package/package.json +1 -1
|
@@ -6751,7 +6751,7 @@ var AutoFrame_default = AutoFrame;
|
|
|
6751
6751
|
|
|
6752
6752
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Preview/styles.module.css#css-module
|
|
6753
6753
|
init_react_import();
|
|
6754
|
-
var styles_module_default20 = { "EditorPreview": "
|
|
6754
|
+
var styles_module_default20 = { "EditorPreview": "_EditorPreview_1ybfe_1", "EditorPreview-frame": "_EditorPreview-frame_1ybfe_6" };
|
|
6755
6755
|
|
|
6756
6756
|
// components/Editor/components/Preview/index.tsx
|
|
6757
6757
|
import { Fragment as Fragment10, jsx as jsx42 } from "react/jsx-runtime";
|
|
@@ -7403,7 +7403,7 @@ import {
|
|
|
7403
7403
|
|
|
7404
7404
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Layout/styles.module.css#css-module
|
|
7405
7405
|
init_react_import();
|
|
7406
|
-
var styles_module_default22 = { "Editor": "
|
|
7406
|
+
var styles_module_default22 = { "Editor": "_Editor_l0swf_19", "Editor-portal": "_Editor-portal_l0swf_32", "EditorLayout": "_EditorLayout_l0swf_37", "EditorLayout-inner": "_EditorLayout-inner_l0swf_41", "Editor--hidePlugins": "_Editor--hidePlugins_l0swf_72", "EditorLayout--navBarVisible": "_EditorLayout--navBarVisible_l0swf_73", "EditorLayout--mounted": "_EditorLayout--mounted_l0swf_82", "EditorLayout--mobilePanelHeightToggle": "_EditorLayout--mobilePanelHeightToggle_l0swf_86", "EditorLayout--leftSideBarVisible": "_EditorLayout--leftSideBarVisible_l0swf_86", "EditorLayout--mobilePanelCustomHeight": "_EditorLayout--mobilePanelCustomHeight_l0swf_91", "EditorLayout--mobilePanelHeightMinContent": "_EditorLayout--mobilePanelHeightMinContent_l0swf_109", "EditorLayout--rightSideBarVisible": "_EditorLayout--rightSideBarVisible_l0swf_129", "EditorLayout-mounted": "_EditorLayout-mounted_l0swf_146", "EditorLayout-header": "_EditorLayout-header_l0swf_187", "EditorHeader": "_EditorHeader_l0swf_194", "EditorHeader-plugins": "_EditorHeader-plugins_l0swf_221", "EditorHeader-pluginItem": "_EditorHeader-pluginItem_l0swf_235", "EditorHeader-pluginItem--mobileOnly": "_EditorHeader-pluginItem--mobileOnly_l0swf_241", "EditorHeader-pluginItem--desktopOnly": "_EditorHeader-pluginItem--desktopOnly_l0swf_246", "EditorHeader-urlBarSlot": "_EditorHeader-urlBarSlot_l0swf_256", "EditorHeader-actions": "_EditorHeader-actions_l0swf_274", "EditorHeader-history": "_EditorHeader-history_l0swf_282", "EditorLayout-mobilePanel": "_EditorLayout-mobilePanel_l0swf_288", "EditorLayout-mobilePanelContent": "_EditorLayout-mobilePanelContent_l0swf_308", "EditorLayout-mobileDragHandle": "_EditorLayout-mobileDragHandle_l0swf_315", "EditorLayout-mobileDragHandlePill": "_EditorLayout-mobileDragHandlePill_l0swf_329", "EditorPluginTab": "_EditorPluginTab_l0swf_336", "EditorPluginTab--visible": "_EditorPluginTab--visible_l0swf_342", "EditorPluginTab-body": "_EditorPluginTab-body_l0swf_347" };
|
|
7407
7407
|
|
|
7408
7408
|
// lib/use-inject-css.ts
|
|
7409
7409
|
init_react_import();
|
|
@@ -7619,7 +7619,7 @@ function ComboboxEmpty(_a) {
|
|
|
7619
7619
|
|
|
7620
7620
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/BrowserBar/styles.module.css#css-module
|
|
7621
7621
|
init_react_import();
|
|
7622
|
-
var styles_module_default25 = { "BrowserBar": "
|
|
7622
|
+
var styles_module_default25 = { "BrowserBar": "_BrowserBar_glswb_1", "BrowserBar-urlTrigger": "_BrowserBar-urlTrigger_glswb_16", "BrowserBar-urlIcon": "_BrowserBar-urlIcon_glswb_46", "BrowserBar-urlText": "_BrowserBar-urlText_glswb_51", "BrowserBar-urlInput": "_BrowserBar-urlInput_glswb_63", "BrowserBar-itemPath": "_BrowserBar-itemPath_glswb_69", "BrowserBar-itemTitle": "_BrowserBar-itemTitle_glswb_74", "BrowserBar-actions": "_BrowserBar-actions_glswb_82", "BrowserBar-deviceIcon": "_BrowserBar-deviceIcon_glswb_92" };
|
|
7623
7623
|
|
|
7624
7624
|
// components/BrowserBar/index.tsx
|
|
7625
7625
|
import { jsx as jsx48, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
@@ -7633,33 +7633,9 @@ var DEVICE_VIEWPORTS = {
|
|
|
7633
7633
|
desktop: { width: "100%", height: "auto", icon: "Monitor", label: "Desktop" },
|
|
7634
7634
|
mobile: { width: 360, height: "auto", icon: "Smartphone", label: "Mobile" }
|
|
7635
7635
|
};
|
|
7636
|
-
var
|
|
7637
|
-
onViewportChange
|
|
7638
|
-
}) => {
|
|
7636
|
+
var UrlBar = () => {
|
|
7639
7637
|
const { routes, currentRoute, onRouteChange } = usePropsContext();
|
|
7640
7638
|
const chrome = useChromeConfig();
|
|
7641
|
-
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
7642
|
-
const dispatch = useAppStore((s) => s.dispatch);
|
|
7643
|
-
const isFullScreen = useAppStore(
|
|
7644
|
-
(s) => {
|
|
7645
|
-
var _a;
|
|
7646
|
-
return (_a = s.state.ui.canvasFullScreen) != null ? _a : false;
|
|
7647
|
-
}
|
|
7648
|
-
);
|
|
7649
|
-
const toggleFullScreen = () => {
|
|
7650
|
-
dispatch({
|
|
7651
|
-
type: "setUi",
|
|
7652
|
-
ui: { canvasFullScreen: !isFullScreen }
|
|
7653
|
-
});
|
|
7654
|
-
};
|
|
7655
|
-
const activeDevice = useMemo20(() => {
|
|
7656
|
-
const w = viewports.current.width;
|
|
7657
|
-
if (typeof w === "number" && w <= 640) return "mobile";
|
|
7658
|
-
return "desktop";
|
|
7659
|
-
}, [viewports.current.width]);
|
|
7660
|
-
const setDevice = (device) => {
|
|
7661
|
-
onViewportChange == null ? void 0 : onViewportChange(DEVICE_VIEWPORTS[device]);
|
|
7662
|
-
};
|
|
7663
7639
|
const showRoutePicker = !!routes && currentRoute !== void 0 && !!onRouteChange;
|
|
7664
7640
|
const [inputValue, setInputValue] = useState20(currentRoute != null ? currentRoute : "");
|
|
7665
7641
|
const lastSyncedPath = useRef13(currentRoute);
|
|
@@ -7672,11 +7648,9 @@ var BrowserBar = ({
|
|
|
7672
7648
|
if (!next || next === currentRoute) return;
|
|
7673
7649
|
void (onRouteChange == null ? void 0 : onRouteChange(next));
|
|
7674
7650
|
};
|
|
7675
|
-
if (!chrome.showUrlBar
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
return /* @__PURE__ */ jsxs20("div", { className: getClassName29(), children: [
|
|
7679
|
-
chrome.showUrlBar && (showRoutePicker ? /* @__PURE__ */ jsxs20(
|
|
7651
|
+
if (!chrome.showUrlBar) return null;
|
|
7652
|
+
if (showRoutePicker) {
|
|
7653
|
+
return /* @__PURE__ */ jsxs20(
|
|
7680
7654
|
Combobox,
|
|
7681
7655
|
{
|
|
7682
7656
|
items: routes,
|
|
@@ -7717,36 +7691,60 @@ var BrowserBar = ({
|
|
|
7717
7691
|
] })
|
|
7718
7692
|
]
|
|
7719
7693
|
}
|
|
7720
|
-
)
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
chrome.showDeviceToggle && /* @__PURE__ */ jsx48(
|
|
7726
|
-
IconButton,
|
|
7727
|
-
{
|
|
7728
|
-
type: "button",
|
|
7729
|
-
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
7730
|
-
onClick: () => setDevice(activeDevice === "desktop" ? "mobile" : "desktop"),
|
|
7731
|
-
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ jsx48(Monitor, { size: 16 }) : /* @__PURE__ */ jsx48(Smartphone, { size: 16 }) })
|
|
7732
|
-
}
|
|
7733
|
-
),
|
|
7734
|
-
chrome.showFullScreenToggle && /* @__PURE__ */ jsx48(
|
|
7735
|
-
IconButton,
|
|
7736
|
-
{
|
|
7737
|
-
type: "button",
|
|
7738
|
-
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
7739
|
-
onClick: toggleFullScreen,
|
|
7740
|
-
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ jsx48(Minimize, { size: 16 }) : /* @__PURE__ */ jsx48(Maximize, { size: 16 }) })
|
|
7741
|
-
}
|
|
7742
|
-
)
|
|
7743
|
-
] })
|
|
7694
|
+
);
|
|
7695
|
+
}
|
|
7696
|
+
return /* @__PURE__ */ jsxs20("div", { className: getClassName29("urlTrigger"), children: [
|
|
7697
|
+
/* @__PURE__ */ jsx48(Globe, { className: getClassName29("urlIcon"), size: 14 }),
|
|
7698
|
+
/* @__PURE__ */ jsx48("span", { className: getClassName29("urlText"), children: "/" })
|
|
7744
7699
|
] });
|
|
7745
7700
|
};
|
|
7701
|
+
var DeviceToggle = ({
|
|
7702
|
+
onViewportChange
|
|
7703
|
+
}) => {
|
|
7704
|
+
const chrome = useChromeConfig();
|
|
7705
|
+
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
7706
|
+
const activeDevice = useMemo20(() => {
|
|
7707
|
+
const w = viewports.current.width;
|
|
7708
|
+
if (typeof w === "number" && w <= 640) return "mobile";
|
|
7709
|
+
return "desktop";
|
|
7710
|
+
}, [viewports.current.width]);
|
|
7711
|
+
if (!chrome.showDeviceToggle) return null;
|
|
7712
|
+
return /* @__PURE__ */ jsx48(
|
|
7713
|
+
IconButton,
|
|
7714
|
+
{
|
|
7715
|
+
type: "button",
|
|
7716
|
+
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
7717
|
+
onClick: () => onViewportChange == null ? void 0 : onViewportChange(
|
|
7718
|
+
DEVICE_VIEWPORTS[activeDevice === "desktop" ? "mobile" : "desktop"]
|
|
7719
|
+
),
|
|
7720
|
+
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ jsx48(Monitor, { size: 14 }) : /* @__PURE__ */ jsx48(Smartphone, { size: 14 }) })
|
|
7721
|
+
}
|
|
7722
|
+
);
|
|
7723
|
+
};
|
|
7724
|
+
var FullScreenToggle = () => {
|
|
7725
|
+
const chrome = useChromeConfig();
|
|
7726
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
7727
|
+
const isFullScreen = useAppStore(
|
|
7728
|
+
(s) => {
|
|
7729
|
+
var _a;
|
|
7730
|
+
return (_a = s.state.ui.canvasFullScreen) != null ? _a : false;
|
|
7731
|
+
}
|
|
7732
|
+
);
|
|
7733
|
+
if (!chrome.showFullScreenToggle) return null;
|
|
7734
|
+
return /* @__PURE__ */ jsx48(
|
|
7735
|
+
IconButton,
|
|
7736
|
+
{
|
|
7737
|
+
type: "button",
|
|
7738
|
+
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
7739
|
+
onClick: () => dispatch({ type: "setUi", ui: { canvasFullScreen: !isFullScreen } }),
|
|
7740
|
+
children: /* @__PURE__ */ jsx48("span", { className: getClassName29("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ jsx48(Minimize, { size: 14 }) : /* @__PURE__ */ jsx48(Maximize, { size: 14 }) })
|
|
7741
|
+
}
|
|
7742
|
+
);
|
|
7743
|
+
};
|
|
7746
7744
|
|
|
7747
7745
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Canvas/styles.module.css#css-module
|
|
7748
7746
|
init_react_import();
|
|
7749
|
-
var styles_module_default26 = { "EditorCanvas": "
|
|
7747
|
+
var styles_module_default26 = { "EditorCanvas": "_EditorCanvas_10xv6_1", "EditorCanvas--fullScreen": "_EditorCanvas--fullScreen_10xv6_24", "EditorCanvas--canvasFullScreen": "_EditorCanvas--canvasFullScreen_10xv6_40", "EditorCanvas-inner": "_EditorCanvas-inner_10xv6_47", "EditorCanvas-rootColumn": "_EditorCanvas-rootColumn_10xv6_56", "EditorCanvas-root": "_EditorCanvas-root_10xv6_56", "EditorCanvas--ready": "_EditorCanvas--ready_10xv6_93", "EditorCanvas-loader": "_EditorCanvas-loader_10xv6_98", "EditorCanvas--showLoader": "_EditorCanvas--showLoader_10xv6_110", "EditorCanvas-bottomBar": "_EditorCanvas-bottomBar_10xv6_119", "EditorCanvas-bottomBarPill": "_EditorCanvas-bottomBarPill_10xv6_131", "EditorCanvas-bottomBarDivider": "_EditorCanvas-bottomBarDivider_10xv6_144", "EditorCanvas-zoomLevel": "_EditorCanvas-zoomLevel_10xv6_151" };
|
|
7750
7748
|
|
|
7751
7749
|
// components/Editor/components/Canvas/index.tsx
|
|
7752
7750
|
import { useShallow as useShallow9 } from "zustand/react/shallow";
|
|
@@ -7788,9 +7786,14 @@ var ZOOM_STEP = 0.15;
|
|
|
7788
7786
|
var MIN_ZOOM = 0.25;
|
|
7789
7787
|
var MAX_ZOOM = 3;
|
|
7790
7788
|
var TRANSITION_DURATION = 150;
|
|
7791
|
-
var Canvas = (
|
|
7789
|
+
var Canvas = ({
|
|
7790
|
+
themeIcon,
|
|
7791
|
+
themeLabel,
|
|
7792
|
+
onToggleTheme
|
|
7793
|
+
} = {}) => {
|
|
7792
7794
|
var _a, _b;
|
|
7793
7795
|
const { frameRef } = useCanvasFrame();
|
|
7796
|
+
const chrome = useChromeConfig();
|
|
7794
7797
|
const {
|
|
7795
7798
|
viewports: viewportOptions = defaultViewports,
|
|
7796
7799
|
ui: uiProp,
|
|
@@ -7973,12 +7976,7 @@ var Canvas = () => {
|
|
|
7973
7976
|
}
|
|
7974
7977
|
},
|
|
7975
7978
|
children: /* @__PURE__ */ jsxs21("div", { className: getClassName30("inner"), ref: frameRef, children: [
|
|
7976
|
-
|
|
7977
|
-
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Zoom out", onClick: zoomOut, children: /* @__PURE__ */ jsx50(Minus, { size: 14 }) }),
|
|
7978
|
-
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Reset zoom", onClick: resetZoom, children: /* @__PURE__ */ jsx50(RotateCcw, { size: 14 }) }),
|
|
7979
|
-
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ jsx50(Plus, { size: 14 }) })
|
|
7980
|
-
] }),
|
|
7981
|
-
/* @__PURE__ */ jsxs21(
|
|
7979
|
+
/* @__PURE__ */ jsx50(
|
|
7982
7980
|
"div",
|
|
7983
7981
|
{
|
|
7984
7982
|
className: getClassName30("rootColumn"),
|
|
@@ -7988,40 +7986,76 @@ var Canvas = () => {
|
|
|
7988
7986
|
transformOrigin: disableZoomControls ? void 0 : "center center",
|
|
7989
7987
|
transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : disableZoomControls ? void 0 : "transform 150ms ease-out"
|
|
7990
7988
|
},
|
|
7991
|
-
children:
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
viewports: __spreadProps(__spreadValues({}, viewports), { current: uiViewport })
|
|
8005
|
-
});
|
|
8006
|
-
}
|
|
8007
|
-
}
|
|
8008
|
-
) }),
|
|
8009
|
-
/* @__PURE__ */ jsx50(
|
|
8010
|
-
"div",
|
|
8011
|
-
{
|
|
8012
|
-
className: getClassName30("root"),
|
|
8013
|
-
suppressHydrationWarning: true,
|
|
8014
|
-
id: "editor-canvas-root",
|
|
8015
|
-
onTransitionEnd: () => {
|
|
8016
|
-
setShowTransition(false);
|
|
8017
|
-
isResizingRef.current = false;
|
|
8018
|
-
},
|
|
8019
|
-
children: /* @__PURE__ */ jsx50(CustomPreview, { children: /* @__PURE__ */ jsx50(Preview2, {}) })
|
|
8020
|
-
}
|
|
8021
|
-
)
|
|
8022
|
-
]
|
|
7989
|
+
children: /* @__PURE__ */ jsx50(
|
|
7990
|
+
"div",
|
|
7991
|
+
{
|
|
7992
|
+
className: getClassName30("root"),
|
|
7993
|
+
suppressHydrationWarning: true,
|
|
7994
|
+
id: "editor-canvas-root",
|
|
7995
|
+
onTransitionEnd: () => {
|
|
7996
|
+
setShowTransition(false);
|
|
7997
|
+
isResizingRef.current = false;
|
|
7998
|
+
},
|
|
7999
|
+
children: /* @__PURE__ */ jsx50(CustomPreview, { children: /* @__PURE__ */ jsx50(Preview2, {}) })
|
|
8000
|
+
}
|
|
8001
|
+
)
|
|
8023
8002
|
}
|
|
8024
8003
|
),
|
|
8004
|
+
/* @__PURE__ */ jsx50("div", { className: getClassName30("bottomBar"), children: /* @__PURE__ */ jsxs21("div", { className: getClassName30("bottomBarPill"), children: [
|
|
8005
|
+
chrome.showThemeToggle && onToggleTheme && /* @__PURE__ */ jsx50(
|
|
8006
|
+
IconButton,
|
|
8007
|
+
{
|
|
8008
|
+
type: "button",
|
|
8009
|
+
title: themeLabel != null ? themeLabel : "Toggle theme",
|
|
8010
|
+
onClick: onToggleTheme,
|
|
8011
|
+
children: themeIcon
|
|
8012
|
+
}
|
|
8013
|
+
),
|
|
8014
|
+
/* @__PURE__ */ jsx50(
|
|
8015
|
+
DeviceToggle,
|
|
8016
|
+
{
|
|
8017
|
+
onViewportChange: (viewport) => {
|
|
8018
|
+
autoSelectingRef.current = false;
|
|
8019
|
+
setShowTransition(true);
|
|
8020
|
+
isResizingRef.current = true;
|
|
8021
|
+
const uiViewport = __spreadProps(__spreadValues({}, viewport), {
|
|
8022
|
+
height: viewport.height || "auto",
|
|
8023
|
+
zoom: 1
|
|
8024
|
+
});
|
|
8025
|
+
setUi({
|
|
8026
|
+
viewports: __spreadProps(__spreadValues({}, viewports), { current: uiViewport })
|
|
8027
|
+
});
|
|
8028
|
+
}
|
|
8029
|
+
}
|
|
8030
|
+
),
|
|
8031
|
+
/* @__PURE__ */ jsx50(FullScreenToggle, {}),
|
|
8032
|
+
!disableZoomControls && /* @__PURE__ */ jsxs21(Fragment13, { children: [
|
|
8033
|
+
/* @__PURE__ */ jsx50("span", { className: getClassName30("bottomBarDivider") }),
|
|
8034
|
+
/* @__PURE__ */ jsx50(
|
|
8035
|
+
IconButton,
|
|
8036
|
+
{
|
|
8037
|
+
type: "button",
|
|
8038
|
+
title: "Zoom out",
|
|
8039
|
+
onClick: zoomOut,
|
|
8040
|
+
children: /* @__PURE__ */ jsx50(Minus, { size: 14 })
|
|
8041
|
+
}
|
|
8042
|
+
),
|
|
8043
|
+
/* @__PURE__ */ jsxs21("span", { className: getClassName30("zoomLevel"), children: [
|
|
8044
|
+
Math.round(canvasZoom * 100),
|
|
8045
|
+
"%"
|
|
8046
|
+
] }),
|
|
8047
|
+
/* @__PURE__ */ jsx50(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ jsx50(Plus, { size: 14 }) }),
|
|
8048
|
+
/* @__PURE__ */ jsx50(
|
|
8049
|
+
IconButton,
|
|
8050
|
+
{
|
|
8051
|
+
type: "button",
|
|
8052
|
+
title: "Reset zoom",
|
|
8053
|
+
onClick: resetZoom,
|
|
8054
|
+
children: /* @__PURE__ */ jsx50(RotateCcw, { size: 14 })
|
|
8055
|
+
}
|
|
8056
|
+
)
|
|
8057
|
+
] })
|
|
8058
|
+
] }) }),
|
|
8025
8059
|
/* @__PURE__ */ jsx50("div", { className: getClassName30("loader"), children: /* @__PURE__ */ jsx50(Loader, { size: 24 }) })
|
|
8026
8060
|
] })
|
|
8027
8061
|
}
|
|
@@ -8381,56 +8415,15 @@ var useClipboardHotkeys = () => {
|
|
|
8381
8415
|
useHotkey({ ctrl: true, x: true }, cutSelectedComponent);
|
|
8382
8416
|
};
|
|
8383
8417
|
|
|
8384
|
-
// components/Editor/components/Nav/index.tsx
|
|
8385
|
-
init_react_import();
|
|
8386
|
-
|
|
8387
|
-
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Nav/styles.module.css#css-module
|
|
8388
|
-
init_react_import();
|
|
8389
|
-
var styles_module_default29 = { "Nav": "_Nav_1g4tk_1", "Nav-list": "_Nav-list_1g4tk_18", "Nav-footer": "_Nav-footer_1g4tk_42", "NavItem-link": "_NavItem-link_1g4tk_55", "NavItem-linkLabel": "_NavItem-linkLabel_1g4tk_83", "NavItem": "_NavItem_1g4tk_55", "NavItem-linkIcon": "_NavItem-linkIcon_1g4tk_108", "NavItem--active": "_NavItem--active_1g4tk_121", "NavItem--mobileOnly": "_NavItem--mobileOnly_1g4tk_132", "NavItem--desktopOnly": "_NavItem--desktopOnly_1g4tk_137" };
|
|
8390
|
-
|
|
8391
|
-
// components/Editor/components/Nav/index.tsx
|
|
8392
|
-
import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8393
|
-
var getClassName33 = get_class_name_factory_default("Nav", styles_module_default29);
|
|
8394
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default29);
|
|
8395
|
-
var MenuItem = ({
|
|
8396
|
-
label,
|
|
8397
|
-
icon,
|
|
8398
|
-
onClick,
|
|
8399
|
-
isActive,
|
|
8400
|
-
mobileOnly,
|
|
8401
|
-
desktopOnly
|
|
8402
|
-
}) => {
|
|
8403
|
-
return /* @__PURE__ */ jsx53(
|
|
8404
|
-
"li",
|
|
8405
|
-
{
|
|
8406
|
-
className: getClassNameItem3({
|
|
8407
|
-
active: isActive,
|
|
8408
|
-
mobileOnly,
|
|
8409
|
-
desktopOnly
|
|
8410
|
-
}),
|
|
8411
|
-
children: onClick && /* @__PURE__ */ jsxs23("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
8412
|
-
icon && /* @__PURE__ */ jsx53("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
8413
|
-
/* @__PURE__ */ jsx53("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
8414
|
-
] })
|
|
8415
|
-
}
|
|
8416
|
-
);
|
|
8417
|
-
};
|
|
8418
|
-
var Nav = ({
|
|
8419
|
-
items,
|
|
8420
|
-
footer
|
|
8421
|
-
}) => {
|
|
8422
|
-
return /* @__PURE__ */ jsxs23("nav", { className: getClassName33(), children: [
|
|
8423
|
-
/* @__PURE__ */ jsx53("ul", { className: getClassName33("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ jsx53(MenuItem, __spreadValues({}, item), key)) }),
|
|
8424
|
-
footer && /* @__PURE__ */ jsx53("div", { className: getClassName33("footer"), children: footer })
|
|
8425
|
-
] });
|
|
8426
|
-
};
|
|
8427
|
-
|
|
8428
8418
|
// components/Editor/components/Layout/index.tsx
|
|
8429
|
-
import {
|
|
8430
|
-
var
|
|
8419
|
+
import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8420
|
+
var getClassName33 = get_class_name_factory_default("Editor", styles_module_default22);
|
|
8431
8421
|
var getLayoutClassName = get_class_name_factory_default("EditorLayout", styles_module_default22);
|
|
8432
8422
|
var getPluginTabClassName = get_class_name_factory_default("EditorPluginTab", styles_module_default22);
|
|
8433
|
-
var
|
|
8423
|
+
var getHeaderClassName = get_class_name_factory_default("EditorHeader", styles_module_default22);
|
|
8424
|
+
var TopHeader = ({
|
|
8425
|
+
pluginItems
|
|
8426
|
+
}) => {
|
|
8434
8427
|
const appStore = useAppStoreApi();
|
|
8435
8428
|
const { onPublish, currentRoute } = usePropsContext();
|
|
8436
8429
|
const chrome = useChromeConfig();
|
|
@@ -8441,39 +8434,62 @@ var FieldSideBarToolbar = () => {
|
|
|
8441
8434
|
const CustomHeaderActions = useAppStore(
|
|
8442
8435
|
(s) => s.overrides.headerActions || DefaultOverride
|
|
8443
8436
|
);
|
|
8444
|
-
return /* @__PURE__ */
|
|
8445
|
-
|
|
8446
|
-
|
|
8447
|
-
|
|
8448
|
-
{
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8437
|
+
return /* @__PURE__ */ jsxs23("header", { className: getHeaderClassName(), children: [
|
|
8438
|
+
/* @__PURE__ */ jsx53("div", { className: getHeaderClassName("plugins"), children: Object.entries(pluginItems).map(([key, item]) => /* @__PURE__ */ jsx53(
|
|
8439
|
+
"span",
|
|
8440
|
+
{
|
|
8441
|
+
className: getHeaderClassName("pluginItem", {
|
|
8442
|
+
mobileOnly: item.mobileOnly,
|
|
8443
|
+
desktopOnly: item.desktopOnly
|
|
8444
|
+
}),
|
|
8445
|
+
children: /* @__PURE__ */ jsx53(
|
|
8446
|
+
IconButton,
|
|
8447
|
+
{
|
|
8448
|
+
type: "button",
|
|
8449
|
+
title: item.label,
|
|
8450
|
+
onClick: item.onClick,
|
|
8451
|
+
active: item.isActive,
|
|
8452
|
+
children: item.icon
|
|
8453
|
+
}
|
|
8454
|
+
)
|
|
8455
|
+
},
|
|
8456
|
+
key
|
|
8457
|
+
)) }),
|
|
8458
|
+
/* @__PURE__ */ jsx53("div", { className: getHeaderClassName("urlBarSlot"), children: /* @__PURE__ */ jsx53(UrlBar, {}) }),
|
|
8459
|
+
/* @__PURE__ */ jsxs23("div", { className: getHeaderClassName("actions"), children: [
|
|
8460
|
+
chrome.showHistoryControls && /* @__PURE__ */ jsxs23("div", { className: getHeaderClassName("history"), children: [
|
|
8461
|
+
/* @__PURE__ */ jsx53(
|
|
8462
|
+
IconButton,
|
|
8463
|
+
{
|
|
8464
|
+
type: "button",
|
|
8465
|
+
title: "undo",
|
|
8466
|
+
disabled: !hasPast,
|
|
8467
|
+
onClick: back,
|
|
8468
|
+
children: /* @__PURE__ */ jsx53(Undo2, { size: 18 })
|
|
8469
|
+
}
|
|
8470
|
+
),
|
|
8471
|
+
/* @__PURE__ */ jsx53(
|
|
8472
|
+
IconButton,
|
|
8473
|
+
{
|
|
8474
|
+
type: "button",
|
|
8475
|
+
title: "redo",
|
|
8476
|
+
disabled: !hasFuture,
|
|
8477
|
+
onClick: forward,
|
|
8478
|
+
children: /* @__PURE__ */ jsx53(Redo2, { size: 18 })
|
|
8479
|
+
}
|
|
8480
|
+
)
|
|
8481
|
+
] }),
|
|
8482
|
+
/* @__PURE__ */ jsx53(CustomHeaderActions, { children: /* @__PURE__ */ jsx53(
|
|
8483
|
+
Button,
|
|
8458
8484
|
{
|
|
8459
|
-
|
|
8460
|
-
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
children:
|
|
8485
|
+
onClick: () => {
|
|
8486
|
+
const data = appStore.getState().state.data;
|
|
8487
|
+
onPublish && onPublish(data, currentRoute);
|
|
8488
|
+
},
|
|
8489
|
+
children: "Publish"
|
|
8464
8490
|
}
|
|
8465
|
-
)
|
|
8466
|
-
] })
|
|
8467
|
-
/* @__PURE__ */ jsx54("div", { className: getClassName34("fieldSideBarActions"), children: /* @__PURE__ */ jsx54(CustomHeaderActions, { children: /* @__PURE__ */ jsx54(
|
|
8468
|
-
Button,
|
|
8469
|
-
{
|
|
8470
|
-
onClick: () => {
|
|
8471
|
-
const data = appStore.getState().state.data;
|
|
8472
|
-
onPublish && onPublish(data, currentRoute);
|
|
8473
|
-
},
|
|
8474
|
-
children: "Publish"
|
|
8475
|
-
}
|
|
8476
|
-
) }) })
|
|
8491
|
+
) })
|
|
8492
|
+
] })
|
|
8477
8493
|
] });
|
|
8478
8494
|
};
|
|
8479
8495
|
var FieldSideBar = () => {
|
|
@@ -8483,17 +8499,14 @@ var FieldSideBar = () => {
|
|
|
8483
8499
|
return s.selectedItem ? (_b = (_a = s.config.components[s.selectedItem.type]) == null ? void 0 : _a["label"]) != null ? _b : s.selectedItem.type.toString() : ((_c = s.config.root) == null ? void 0 : _c.label) || "Page";
|
|
8484
8500
|
}
|
|
8485
8501
|
);
|
|
8486
|
-
return /* @__PURE__ */
|
|
8487
|
-
/* @__PURE__ */ jsx54(FieldSideBarToolbar, {}),
|
|
8488
|
-
/* @__PURE__ */ jsx54(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ jsx54(Fields, {}) })
|
|
8489
|
-
] });
|
|
8502
|
+
return /* @__PURE__ */ jsx53(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ jsx53(Fields, {}) });
|
|
8490
8503
|
};
|
|
8491
8504
|
var PluginTab = ({
|
|
8492
8505
|
children,
|
|
8493
8506
|
visible,
|
|
8494
8507
|
mobileOnly
|
|
8495
8508
|
}) => {
|
|
8496
|
-
return /* @__PURE__ */
|
|
8509
|
+
return /* @__PURE__ */ jsx53("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ jsx53("div", { className: getPluginTabClassName("body"), children }) });
|
|
8497
8510
|
};
|
|
8498
8511
|
var Layout = ({ children }) => {
|
|
8499
8512
|
const {
|
|
@@ -8662,7 +8675,7 @@ var Layout = ({ children }) => {
|
|
|
8662
8675
|
const toggleTheme = () => {
|
|
8663
8676
|
setTheme((t) => t === "dark" ? "light" : "dark");
|
|
8664
8677
|
};
|
|
8665
|
-
const themeIcon = theme === "dark" ? /* @__PURE__ */
|
|
8678
|
+
const themeIcon = theme === "dark" ? /* @__PURE__ */ jsx53(Sun, { size: 14 }) : /* @__PURE__ */ jsx53(Moon, { size: 14 });
|
|
8666
8679
|
const themeLabel = theme === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
8667
8680
|
const hasLegacySideBarPlugin = useMemo23(
|
|
8668
8681
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
@@ -8687,7 +8700,7 @@ var Layout = ({ children }) => {
|
|
|
8687
8700
|
}
|
|
8688
8701
|
details[plugin.name] = {
|
|
8689
8702
|
label: (_a = plugin.label) != null ? _a : plugin.name,
|
|
8690
|
-
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */
|
|
8703
|
+
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ jsx53(ToyBrick, {}),
|
|
8691
8704
|
onClick: () => {
|
|
8692
8705
|
var _a2;
|
|
8693
8706
|
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
@@ -8726,17 +8739,17 @@ var Layout = ({ children }) => {
|
|
|
8726
8739
|
if (mobilePanelHeight && leftSideBarVisible) {
|
|
8727
8740
|
mobilePanelStyle["--editor-mobile-panel-height"] = `${mobilePanelHeight}px`;
|
|
8728
8741
|
}
|
|
8729
|
-
return /* @__PURE__ */
|
|
8742
|
+
return /* @__PURE__ */ jsxs23(
|
|
8730
8743
|
"div",
|
|
8731
8744
|
{
|
|
8732
|
-
className: `Editor ${
|
|
8745
|
+
className: `Editor ${getClassName33({
|
|
8733
8746
|
hidePlugins: hasLegacySideBarPlugin
|
|
8734
8747
|
})}`,
|
|
8735
8748
|
id: instanceId,
|
|
8736
8749
|
"data-theme": theme,
|
|
8737
8750
|
style: { height },
|
|
8738
8751
|
children: [
|
|
8739
|
-
/* @__PURE__ */
|
|
8752
|
+
/* @__PURE__ */ jsx53(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ jsx53(CustomEditor, { children: children || /* @__PURE__ */ jsx53(FrameProvider, { children: /* @__PURE__ */ jsx53(
|
|
8740
8753
|
"div",
|
|
8741
8754
|
{
|
|
8742
8755
|
className: getLayoutClassName({
|
|
@@ -8749,40 +8762,26 @@ var Layout = ({ children }) => {
|
|
|
8749
8762
|
mobilePanelCustomHeight: mobilePanelHeight !== null && leftSideBarVisible
|
|
8750
8763
|
}),
|
|
8751
8764
|
style: { height },
|
|
8752
|
-
children: /* @__PURE__ */
|
|
8765
|
+
children: /* @__PURE__ */ jsxs23(
|
|
8753
8766
|
"div",
|
|
8754
8767
|
{
|
|
8755
8768
|
className: getLayoutClassName("inner"),
|
|
8756
8769
|
style: __spreadValues(__spreadValues({}, layoutOptions), mobilePanelStyle),
|
|
8757
8770
|
children: [
|
|
8758
|
-
navBarVisible && /* @__PURE__ */
|
|
8759
|
-
|
|
8760
|
-
{
|
|
8761
|
-
items: pluginItems,
|
|
8762
|
-
footer: chrome.showThemeToggle ? /* @__PURE__ */ jsx54(
|
|
8763
|
-
IconButton,
|
|
8764
|
-
{
|
|
8765
|
-
type: "button",
|
|
8766
|
-
title: themeLabel,
|
|
8767
|
-
onClick: toggleTheme,
|
|
8768
|
-
children: themeIcon
|
|
8769
|
-
}
|
|
8770
|
-
) : void 0
|
|
8771
|
-
}
|
|
8772
|
-
) }),
|
|
8773
|
-
/* @__PURE__ */ jsxs24(
|
|
8771
|
+
navBarVisible && /* @__PURE__ */ jsx53("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ jsx53(TopHeader, { pluginItems }) }),
|
|
8772
|
+
/* @__PURE__ */ jsxs23(
|
|
8774
8773
|
"div",
|
|
8775
8774
|
{
|
|
8776
8775
|
ref: mobilePanelRef,
|
|
8777
8776
|
className: getLayoutClassName("mobilePanel"),
|
|
8778
8777
|
children: [
|
|
8779
|
-
/* @__PURE__ */
|
|
8778
|
+
/* @__PURE__ */ jsx53(
|
|
8780
8779
|
"div",
|
|
8781
8780
|
{
|
|
8782
8781
|
className: getLayoutClassName("mobileDragHandle"),
|
|
8783
8782
|
onTouchStart: (e) => handleMobileDragStart(e.touches[0].clientY),
|
|
8784
8783
|
onMouseDown: (e) => handleMobileDragStart(e.clientY),
|
|
8785
|
-
children: /* @__PURE__ */
|
|
8784
|
+
children: /* @__PURE__ */ jsx53(
|
|
8786
8785
|
"div",
|
|
8787
8786
|
{
|
|
8788
8787
|
className: getLayoutClassName("mobileDragHandlePill")
|
|
@@ -8790,17 +8789,17 @@ var Layout = ({ children }) => {
|
|
|
8790
8789
|
)
|
|
8791
8790
|
}
|
|
8792
8791
|
),
|
|
8793
|
-
/* @__PURE__ */
|
|
8792
|
+
/* @__PURE__ */ jsx53(
|
|
8794
8793
|
"div",
|
|
8795
8794
|
{
|
|
8796
8795
|
className: getLayoutClassName("mobilePanelContent"),
|
|
8797
8796
|
children: Object.entries(pluginItems).map(
|
|
8798
|
-
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */
|
|
8797
|
+
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ jsx53(
|
|
8799
8798
|
PluginTab,
|
|
8800
8799
|
{
|
|
8801
8800
|
visible: currentPlugin === id,
|
|
8802
8801
|
mobileOnly,
|
|
8803
|
-
children: /* @__PURE__ */
|
|
8802
|
+
children: /* @__PURE__ */ jsx53(Render2, {})
|
|
8804
8803
|
},
|
|
8805
8804
|
id
|
|
8806
8805
|
)
|
|
@@ -8810,7 +8809,7 @@ var Layout = ({ children }) => {
|
|
|
8810
8809
|
]
|
|
8811
8810
|
}
|
|
8812
8811
|
),
|
|
8813
|
-
/* @__PURE__ */
|
|
8812
|
+
/* @__PURE__ */ jsx53(
|
|
8814
8813
|
Sidebar,
|
|
8815
8814
|
{
|
|
8816
8815
|
position: "left",
|
|
@@ -8819,20 +8818,28 @@ var Layout = ({ children }) => {
|
|
|
8819
8818
|
onResize: setLeftWidth,
|
|
8820
8819
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
8821
8820
|
children: Object.entries(pluginItems).map(
|
|
8822
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */
|
|
8821
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ jsx53(
|
|
8823
8822
|
PluginTab,
|
|
8824
8823
|
{
|
|
8825
8824
|
visible: currentPlugin === id,
|
|
8826
8825
|
mobileOnly,
|
|
8827
|
-
children: /* @__PURE__ */
|
|
8826
|
+
children: /* @__PURE__ */ jsx53(Render2, {})
|
|
8828
8827
|
},
|
|
8829
8828
|
id
|
|
8830
8829
|
)
|
|
8831
8830
|
)
|
|
8832
8831
|
}
|
|
8833
8832
|
),
|
|
8834
|
-
/* @__PURE__ */
|
|
8835
|
-
|
|
8833
|
+
/* @__PURE__ */ jsx53(
|
|
8834
|
+
Canvas,
|
|
8835
|
+
{
|
|
8836
|
+
theme,
|
|
8837
|
+
themeIcon,
|
|
8838
|
+
themeLabel,
|
|
8839
|
+
onToggleTheme: toggleTheme
|
|
8840
|
+
}
|
|
8841
|
+
),
|
|
8842
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ jsx53(
|
|
8836
8843
|
Sidebar,
|
|
8837
8844
|
{
|
|
8838
8845
|
position: "right",
|
|
@@ -8840,7 +8847,7 @@ var Layout = ({ children }) => {
|
|
|
8840
8847
|
isVisible: rightSideBarVisible,
|
|
8841
8848
|
onResize: setRightWidth,
|
|
8842
8849
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
8843
|
-
children: /* @__PURE__ */
|
|
8850
|
+
children: /* @__PURE__ */ jsx53(FieldSideBar, {})
|
|
8844
8851
|
}
|
|
8845
8852
|
)
|
|
8846
8853
|
]
|
|
@@ -8848,14 +8855,14 @@ var Layout = ({ children }) => {
|
|
|
8848
8855
|
)
|
|
8849
8856
|
}
|
|
8850
8857
|
) }) }) }),
|
|
8851
|
-
/* @__PURE__ */
|
|
8858
|
+
/* @__PURE__ */ jsx53("div", { id: "editor-portal-root", className: getClassName33("portal") })
|
|
8852
8859
|
]
|
|
8853
8860
|
}
|
|
8854
8861
|
);
|
|
8855
8862
|
};
|
|
8856
8863
|
|
|
8857
8864
|
// components/Editor/index.tsx
|
|
8858
|
-
import { jsx as
|
|
8865
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
8859
8866
|
var CHROME_KEYS = [
|
|
8860
8867
|
"showNavBar",
|
|
8861
8868
|
"showThemeToggle",
|
|
@@ -8887,7 +8894,7 @@ var splitUiConfig = (ui) => {
|
|
|
8887
8894
|
};
|
|
8888
8895
|
var propsContext = createContext8({});
|
|
8889
8896
|
function PropsProvider(props) {
|
|
8890
|
-
return /* @__PURE__ */
|
|
8897
|
+
return /* @__PURE__ */ jsx54(propsContext.Provider, { value: props, children: props.children });
|
|
8891
8898
|
}
|
|
8892
8899
|
var usePropsContext = () => useContext15(propsContext);
|
|
8893
8900
|
var useChromeConfig = () => {
|
|
@@ -9077,10 +9084,10 @@ function EditorProvider({ children }) {
|
|
|
9077
9084
|
resolveAndCommitData();
|
|
9078
9085
|
}, 0);
|
|
9079
9086
|
}, []);
|
|
9080
|
-
return /* @__PURE__ */
|
|
9087
|
+
return /* @__PURE__ */ jsx54(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ jsx54(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
|
|
9081
9088
|
}
|
|
9082
9089
|
function Editor3(props) {
|
|
9083
|
-
return /* @__PURE__ */
|
|
9090
|
+
return /* @__PURE__ */ jsx54(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx54(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ jsx54(Layout, { children: props.children }) })) }));
|
|
9084
9091
|
}
|
|
9085
9092
|
Editor3.Components = Components;
|
|
9086
9093
|
Editor3.Fields = Fields;
|
|
@@ -9165,7 +9172,7 @@ import {
|
|
|
9165
9172
|
MemoryRouter,
|
|
9166
9173
|
StaticRouter
|
|
9167
9174
|
} from "react-router";
|
|
9168
|
-
import { jsx as
|
|
9175
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
9169
9176
|
var EDITOR_PATH = "/editor";
|
|
9170
9177
|
var isServer = typeof window === "undefined";
|
|
9171
9178
|
function AppProvider({
|
|
@@ -9186,28 +9193,28 @@ function AppProvider({
|
|
|
9186
9193
|
}),
|
|
9187
9194
|
[config, stablePages, resolvedEditorPath]
|
|
9188
9195
|
);
|
|
9189
|
-
const inner = /* @__PURE__ */
|
|
9196
|
+
const inner = /* @__PURE__ */ jsx55(appConfigContext.Provider, { value: ctxValue, children });
|
|
9190
9197
|
if (isServer) {
|
|
9191
|
-
return /* @__PURE__ */
|
|
9198
|
+
return /* @__PURE__ */ jsx55(StaticRouter, { location: currentPath != null ? currentPath : "/", children: inner });
|
|
9192
9199
|
}
|
|
9193
9200
|
if (router === "hash") {
|
|
9194
|
-
return /* @__PURE__ */
|
|
9201
|
+
return /* @__PURE__ */ jsx55(HashRouter, { children: inner });
|
|
9195
9202
|
}
|
|
9196
9203
|
if (router === "memory") {
|
|
9197
|
-
return /* @__PURE__ */
|
|
9204
|
+
return /* @__PURE__ */ jsx55(MemoryRouter, { initialEntries: [currentPath != null ? currentPath : "/"], children: inner });
|
|
9198
9205
|
}
|
|
9199
|
-
return /* @__PURE__ */
|
|
9206
|
+
return /* @__PURE__ */ jsx55(BrowserRouter, { children: inner });
|
|
9200
9207
|
}
|
|
9201
9208
|
|
|
9202
9209
|
// components/App/App.tsx
|
|
9203
9210
|
init_react_import();
|
|
9204
9211
|
import { Route, Routes } from "react-router";
|
|
9205
|
-
import { Fragment as
|
|
9212
|
+
import { Fragment as Fragment15, jsx as jsx56, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9206
9213
|
var joinEditorPath = (editorPath, route) => {
|
|
9207
9214
|
if (route === "/") return editorPath;
|
|
9208
9215
|
return `${editorPath}${route}`;
|
|
9209
9216
|
};
|
|
9210
|
-
var DefaultNotFound = () => /* @__PURE__ */
|
|
9217
|
+
var DefaultNotFound = () => /* @__PURE__ */ jsx56(
|
|
9211
9218
|
"div",
|
|
9212
9219
|
{
|
|
9213
9220
|
style: {
|
|
@@ -9217,9 +9224,9 @@ var DefaultNotFound = () => /* @__PURE__ */ jsx57(
|
|
|
9217
9224
|
justifyContent: "center",
|
|
9218
9225
|
alignItems: "center"
|
|
9219
9226
|
},
|
|
9220
|
-
children: /* @__PURE__ */
|
|
9221
|
-
/* @__PURE__ */
|
|
9222
|
-
/* @__PURE__ */
|
|
9227
|
+
children: /* @__PURE__ */ jsxs24("div", { children: [
|
|
9228
|
+
/* @__PURE__ */ jsx56("h1", { children: "404" }),
|
|
9229
|
+
/* @__PURE__ */ jsx56("p", { children: "No page matches this route." })
|
|
9223
9230
|
] })
|
|
9224
9231
|
}
|
|
9225
9232
|
);
|
|
@@ -9230,7 +9237,7 @@ function RenderForKey({
|
|
|
9230
9237
|
const { config, pages } = useApp();
|
|
9231
9238
|
const data = pages[routeKey];
|
|
9232
9239
|
if (!data) return null;
|
|
9233
|
-
return /* @__PURE__ */
|
|
9240
|
+
return /* @__PURE__ */ jsx56(
|
|
9234
9241
|
Render,
|
|
9235
9242
|
{
|
|
9236
9243
|
config,
|
|
@@ -9248,7 +9255,7 @@ function EditorForKey({
|
|
|
9248
9255
|
const { config, pages, routes, navigate } = useApp();
|
|
9249
9256
|
const data = pages[routeKey];
|
|
9250
9257
|
if (!data) return null;
|
|
9251
|
-
return /* @__PURE__ */
|
|
9258
|
+
return /* @__PURE__ */ jsx56(
|
|
9252
9259
|
Editor3,
|
|
9253
9260
|
{
|
|
9254
9261
|
config,
|
|
@@ -9285,12 +9292,12 @@ function AppRender({ metadata, renderNotFound }) {
|
|
|
9285
9292
|
const { pages, isEditing } = useApp();
|
|
9286
9293
|
if (isEditing) return null;
|
|
9287
9294
|
const routeKeys = Object.keys(pages);
|
|
9288
|
-
return /* @__PURE__ */
|
|
9289
|
-
routeKeys.map((routeKey) => /* @__PURE__ */
|
|
9295
|
+
return /* @__PURE__ */ jsxs24(Routes, { children: [
|
|
9296
|
+
routeKeys.map((routeKey) => /* @__PURE__ */ jsx56(
|
|
9290
9297
|
Route,
|
|
9291
9298
|
{
|
|
9292
9299
|
path: routeKey,
|
|
9293
|
-
element: /* @__PURE__ */
|
|
9300
|
+
element: /* @__PURE__ */ jsx56(
|
|
9294
9301
|
RenderForKey,
|
|
9295
9302
|
{
|
|
9296
9303
|
routeKey,
|
|
@@ -9300,11 +9307,11 @@ function AppRender({ metadata, renderNotFound }) {
|
|
|
9300
9307
|
},
|
|
9301
9308
|
`render:${routeKey}`
|
|
9302
9309
|
)),
|
|
9303
|
-
/* @__PURE__ */
|
|
9310
|
+
/* @__PURE__ */ jsx56(
|
|
9304
9311
|
Route,
|
|
9305
9312
|
{
|
|
9306
9313
|
path: "*",
|
|
9307
|
-
element: renderNotFound ? /* @__PURE__ */
|
|
9314
|
+
element: renderNotFound ? /* @__PURE__ */ jsx56(Fragment15, { children: renderNotFound() }) : /* @__PURE__ */ jsx56(DefaultNotFound, {})
|
|
9308
9315
|
}
|
|
9309
9316
|
)
|
|
9310
9317
|
] });
|
|
@@ -9314,12 +9321,12 @@ function AppEditor(props) {
|
|
|
9314
9321
|
const { pages, isEditing, editorPath } = useApp();
|
|
9315
9322
|
if (!isEditing || editorPath === null) return null;
|
|
9316
9323
|
const routeKeys = Object.keys(pages);
|
|
9317
|
-
return /* @__PURE__ */
|
|
9318
|
-
routeKeys.map((routeKey) => /* @__PURE__ */
|
|
9324
|
+
return /* @__PURE__ */ jsxs24(Routes, { children: [
|
|
9325
|
+
routeKeys.map((routeKey) => /* @__PURE__ */ jsx56(
|
|
9319
9326
|
Route,
|
|
9320
9327
|
{
|
|
9321
9328
|
path: joinEditorPath(editorPath, routeKey),
|
|
9322
|
-
element: /* @__PURE__ */
|
|
9329
|
+
element: /* @__PURE__ */ jsx56(
|
|
9323
9330
|
EditorForKey,
|
|
9324
9331
|
{
|
|
9325
9332
|
routeKey,
|
|
@@ -9330,26 +9337,26 @@ function AppEditor(props) {
|
|
|
9330
9337
|
},
|
|
9331
9338
|
`edit:${routeKey}`
|
|
9332
9339
|
)),
|
|
9333
|
-
/* @__PURE__ */
|
|
9340
|
+
/* @__PURE__ */ jsx56(
|
|
9334
9341
|
Route,
|
|
9335
9342
|
{
|
|
9336
9343
|
path: "*",
|
|
9337
|
-
element: renderNotFound ? /* @__PURE__ */
|
|
9344
|
+
element: renderNotFound ? /* @__PURE__ */ jsx56(Fragment15, { children: renderNotFound() }) : /* @__PURE__ */ jsx56(DefaultNotFound, {})
|
|
9338
9345
|
}
|
|
9339
9346
|
)
|
|
9340
9347
|
] });
|
|
9341
9348
|
}
|
|
9342
9349
|
function DefaultAppLayout(props) {
|
|
9343
9350
|
const _a = props, { renderNotFound } = _a, editorProps = __objRest(_a, ["renderNotFound"]);
|
|
9344
|
-
return /* @__PURE__ */
|
|
9345
|
-
/* @__PURE__ */
|
|
9351
|
+
return /* @__PURE__ */ jsxs24(Fragment15, { children: [
|
|
9352
|
+
/* @__PURE__ */ jsx56(
|
|
9346
9353
|
AppRender,
|
|
9347
9354
|
{
|
|
9348
9355
|
metadata: editorProps.metadata,
|
|
9349
9356
|
renderNotFound
|
|
9350
9357
|
}
|
|
9351
9358
|
),
|
|
9352
|
-
/* @__PURE__ */
|
|
9359
|
+
/* @__PURE__ */ jsx56(AppEditor, __spreadProps(__spreadValues({}, editorProps), { renderNotFound }))
|
|
9353
9360
|
] });
|
|
9354
9361
|
}
|
|
9355
9362
|
function App(props) {
|
|
@@ -9368,7 +9375,7 @@ function App(props) {
|
|
|
9368
9375
|
"router",
|
|
9369
9376
|
"children"
|
|
9370
9377
|
]);
|
|
9371
|
-
return /* @__PURE__ */
|
|
9378
|
+
return /* @__PURE__ */ jsx56(
|
|
9372
9379
|
AppProvider,
|
|
9373
9380
|
{
|
|
9374
9381
|
config,
|
|
@@ -9376,7 +9383,7 @@ function App(props) {
|
|
|
9376
9383
|
currentPath,
|
|
9377
9384
|
editorPath,
|
|
9378
9385
|
router,
|
|
9379
|
-
children: children != null ? children : /* @__PURE__ */
|
|
9386
|
+
children: children != null ? children : /* @__PURE__ */ jsx56(DefaultAppLayout, __spreadValues({}, layoutProps))
|
|
9380
9387
|
}
|
|
9381
9388
|
);
|
|
9382
9389
|
}
|
|
@@ -9419,26 +9426,26 @@ init_react_import();
|
|
|
9419
9426
|
|
|
9420
9427
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
|
|
9421
9428
|
init_react_import();
|
|
9422
|
-
var
|
|
9429
|
+
var styles_module_default29 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
9423
9430
|
|
|
9424
9431
|
// plugins/outline/index.tsx
|
|
9425
|
-
import { jsx as
|
|
9426
|
-
var
|
|
9432
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
9433
|
+
var getClassName34 = get_class_name_factory_default("OutlinePlugin", styles_module_default29);
|
|
9427
9434
|
var outlinePlugin = () => ({
|
|
9428
9435
|
name: "outline",
|
|
9429
9436
|
label: "Outline",
|
|
9430
|
-
render: () => /* @__PURE__ */
|
|
9431
|
-
icon: /* @__PURE__ */
|
|
9437
|
+
render: () => /* @__PURE__ */ jsx57("div", { className: getClassName34(), children: /* @__PURE__ */ jsx57(Outline, {}) }),
|
|
9438
|
+
icon: /* @__PURE__ */ jsx57(Layers, {})
|
|
9432
9439
|
});
|
|
9433
9440
|
|
|
9434
9441
|
// plugins/legacy-side-bar/index.tsx
|
|
9435
9442
|
init_react_import();
|
|
9436
|
-
import { jsx as
|
|
9443
|
+
import { jsx as jsx58, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9437
9444
|
var legacySideBarPlugin = () => ({
|
|
9438
9445
|
name: "legacy-side-bar",
|
|
9439
|
-
render: () => /* @__PURE__ */
|
|
9440
|
-
/* @__PURE__ */
|
|
9441
|
-
/* @__PURE__ */
|
|
9446
|
+
render: () => /* @__PURE__ */ jsxs25("div", { style: { overflowY: "auto" }, children: [
|
|
9447
|
+
/* @__PURE__ */ jsx58(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ jsx58(Components, {}) }),
|
|
9448
|
+
/* @__PURE__ */ jsx58(SidebarSection, { title: "Outline", children: /* @__PURE__ */ jsx58(Outline, {}) })
|
|
9442
9449
|
] })
|
|
9443
9450
|
});
|
|
9444
9451
|
|