@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
package/dist/index.js
CHANGED
|
@@ -12005,7 +12005,7 @@ var AutoFrame_default = AutoFrame;
|
|
|
12005
12005
|
|
|
12006
12006
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Preview/styles.module.css#css-module
|
|
12007
12007
|
init_react_import();
|
|
12008
|
-
var styles_module_default23 = { "EditorPreview": "
|
|
12008
|
+
var styles_module_default23 = { "EditorPreview": "_EditorPreview_1ybfe_1", "EditorPreview-frame": "_EditorPreview-frame_1ybfe_6" };
|
|
12009
12009
|
|
|
12010
12010
|
// components/Editor/components/Preview/index.tsx
|
|
12011
12011
|
init_lib();
|
|
@@ -12972,7 +12972,7 @@ init_lib();
|
|
|
12972
12972
|
|
|
12973
12973
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Layout/styles.module.css#css-module
|
|
12974
12974
|
init_react_import();
|
|
12975
|
-
var styles_module_default25 = { "Editor": "
|
|
12975
|
+
var styles_module_default25 = { "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" };
|
|
12976
12976
|
|
|
12977
12977
|
// lib/use-inject-css.ts
|
|
12978
12978
|
init_react_import();
|
|
@@ -13286,7 +13286,7 @@ function ComboboxEmpty(_a) {
|
|
|
13286
13286
|
|
|
13287
13287
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/BrowserBar/styles.module.css#css-module
|
|
13288
13288
|
init_react_import();
|
|
13289
|
-
var styles_module_default29 = { "BrowserBar": "
|
|
13289
|
+
var styles_module_default29 = { "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" };
|
|
13290
13290
|
|
|
13291
13291
|
// components/BrowserBar/index.tsx
|
|
13292
13292
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
@@ -13300,33 +13300,9 @@ var DEVICE_VIEWPORTS = {
|
|
|
13300
13300
|
desktop: { width: "100%", height: "auto", icon: "Monitor", label: "Desktop" },
|
|
13301
13301
|
mobile: { width: 360, height: "auto", icon: "Smartphone", label: "Mobile" }
|
|
13302
13302
|
};
|
|
13303
|
-
var
|
|
13304
|
-
onViewportChange
|
|
13305
|
-
}) => {
|
|
13303
|
+
var UrlBar = () => {
|
|
13306
13304
|
const { routes, currentRoute, onRouteChange } = usePropsContext();
|
|
13307
13305
|
const chrome = useChromeConfig();
|
|
13308
|
-
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
13309
|
-
const dispatch = useAppStore((s) => s.dispatch);
|
|
13310
|
-
const isFullScreen = useAppStore(
|
|
13311
|
-
(s) => {
|
|
13312
|
-
var _a;
|
|
13313
|
-
return (_a = s.state.ui.canvasFullScreen) != null ? _a : false;
|
|
13314
|
-
}
|
|
13315
|
-
);
|
|
13316
|
-
const toggleFullScreen = () => {
|
|
13317
|
-
dispatch({
|
|
13318
|
-
type: "setUi",
|
|
13319
|
-
ui: { canvasFullScreen: !isFullScreen }
|
|
13320
|
-
});
|
|
13321
|
-
};
|
|
13322
|
-
const activeDevice = (0, import_react87.useMemo)(() => {
|
|
13323
|
-
const w = viewports.current.width;
|
|
13324
|
-
if (typeof w === "number" && w <= 640) return "mobile";
|
|
13325
|
-
return "desktop";
|
|
13326
|
-
}, [viewports.current.width]);
|
|
13327
|
-
const setDevice = (device) => {
|
|
13328
|
-
onViewportChange == null ? void 0 : onViewportChange(DEVICE_VIEWPORTS[device]);
|
|
13329
|
-
};
|
|
13330
13306
|
const showRoutePicker = !!routes && currentRoute !== void 0 && !!onRouteChange;
|
|
13331
13307
|
const [inputValue, setInputValue] = (0, import_react87.useState)(currentRoute != null ? currentRoute : "");
|
|
13332
13308
|
const lastSyncedPath = (0, import_react87.useRef)(currentRoute);
|
|
@@ -13339,11 +13315,9 @@ var BrowserBar = ({
|
|
|
13339
13315
|
if (!next || next === currentRoute) return;
|
|
13340
13316
|
void (onRouteChange == null ? void 0 : onRouteChange(next));
|
|
13341
13317
|
};
|
|
13342
|
-
if (!chrome.showUrlBar
|
|
13343
|
-
|
|
13344
|
-
|
|
13345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: getClassName36(), children: [
|
|
13346
|
-
chrome.showUrlBar && (showRoutePicker ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
13318
|
+
if (!chrome.showUrlBar) return null;
|
|
13319
|
+
if (showRoutePicker) {
|
|
13320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
13347
13321
|
Combobox,
|
|
13348
13322
|
{
|
|
13349
13323
|
items: routes,
|
|
@@ -13384,36 +13358,60 @@ var BrowserBar = ({
|
|
|
13384
13358
|
] })
|
|
13385
13359
|
]
|
|
13386
13360
|
}
|
|
13387
|
-
)
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13392
|
-
chrome.showDeviceToggle && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13393
|
-
IconButton,
|
|
13394
|
-
{
|
|
13395
|
-
type: "button",
|
|
13396
|
-
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
13397
|
-
onClick: () => setDevice(activeDevice === "desktop" ? "mobile" : "desktop"),
|
|
13398
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: getClassName36("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Monitor, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Smartphone, { size: 16 }) })
|
|
13399
|
-
}
|
|
13400
|
-
),
|
|
13401
|
-
chrome.showFullScreenToggle && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13402
|
-
IconButton,
|
|
13403
|
-
{
|
|
13404
|
-
type: "button",
|
|
13405
|
-
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
13406
|
-
onClick: toggleFullScreen,
|
|
13407
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: getClassName36("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Minimize, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Maximize, { size: 16 }) })
|
|
13408
|
-
}
|
|
13409
|
-
)
|
|
13410
|
-
] })
|
|
13361
|
+
);
|
|
13362
|
+
}
|
|
13363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: getClassName36("urlTrigger"), children: [
|
|
13364
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Globe, { className: getClassName36("urlIcon"), size: 14 }),
|
|
13365
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: getClassName36("urlText"), children: "/" })
|
|
13411
13366
|
] });
|
|
13412
13367
|
};
|
|
13368
|
+
var DeviceToggle = ({
|
|
13369
|
+
onViewportChange
|
|
13370
|
+
}) => {
|
|
13371
|
+
const chrome = useChromeConfig();
|
|
13372
|
+
const viewports = useAppStore((s) => s.state.ui.viewports);
|
|
13373
|
+
const activeDevice = (0, import_react87.useMemo)(() => {
|
|
13374
|
+
const w = viewports.current.width;
|
|
13375
|
+
if (typeof w === "number" && w <= 640) return "mobile";
|
|
13376
|
+
return "desktop";
|
|
13377
|
+
}, [viewports.current.width]);
|
|
13378
|
+
if (!chrome.showDeviceToggle) return null;
|
|
13379
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13380
|
+
IconButton,
|
|
13381
|
+
{
|
|
13382
|
+
type: "button",
|
|
13383
|
+
title: activeDevice === "desktop" ? "Switch to mobile viewport" : "Switch to desktop viewport",
|
|
13384
|
+
onClick: () => onViewportChange == null ? void 0 : onViewportChange(
|
|
13385
|
+
DEVICE_VIEWPORTS[activeDevice === "desktop" ? "mobile" : "desktop"]
|
|
13386
|
+
),
|
|
13387
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: getClassName36("deviceIcon"), children: activeDevice === "desktop" ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Monitor, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Smartphone, { size: 14 }) })
|
|
13388
|
+
}
|
|
13389
|
+
);
|
|
13390
|
+
};
|
|
13391
|
+
var FullScreenToggle = () => {
|
|
13392
|
+
const chrome = useChromeConfig();
|
|
13393
|
+
const dispatch = useAppStore((s) => s.dispatch);
|
|
13394
|
+
const isFullScreen = useAppStore(
|
|
13395
|
+
(s) => {
|
|
13396
|
+
var _a;
|
|
13397
|
+
return (_a = s.state.ui.canvasFullScreen) != null ? _a : false;
|
|
13398
|
+
}
|
|
13399
|
+
);
|
|
13400
|
+
if (!chrome.showFullScreenToggle) return null;
|
|
13401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
13402
|
+
IconButton,
|
|
13403
|
+
{
|
|
13404
|
+
type: "button",
|
|
13405
|
+
title: isFullScreen ? "Exit full screen" : "Enter full screen",
|
|
13406
|
+
onClick: () => dispatch({ type: "setUi", ui: { canvasFullScreen: !isFullScreen } }),
|
|
13407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: getClassName36("deviceIcon"), children: isFullScreen ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Minimize, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Maximize, { size: 14 }) })
|
|
13408
|
+
}
|
|
13409
|
+
);
|
|
13410
|
+
};
|
|
13413
13411
|
|
|
13414
13412
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Canvas/styles.module.css#css-module
|
|
13415
13413
|
init_react_import();
|
|
13416
|
-
var styles_module_default30 = { "EditorCanvas": "
|
|
13414
|
+
var styles_module_default30 = { "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" };
|
|
13417
13415
|
|
|
13418
13416
|
// components/Editor/components/Canvas/index.tsx
|
|
13419
13417
|
init_lib();
|
|
@@ -13454,9 +13452,14 @@ var ZOOM_STEP = 0.15;
|
|
|
13454
13452
|
var MIN_ZOOM = 0.25;
|
|
13455
13453
|
var MAX_ZOOM = 3;
|
|
13456
13454
|
var TRANSITION_DURATION = 150;
|
|
13457
|
-
var Canvas = (
|
|
13455
|
+
var Canvas = ({
|
|
13456
|
+
themeIcon,
|
|
13457
|
+
themeLabel,
|
|
13458
|
+
onToggleTheme
|
|
13459
|
+
} = {}) => {
|
|
13458
13460
|
var _a, _b;
|
|
13459
13461
|
const { frameRef } = useCanvasFrame();
|
|
13462
|
+
const chrome = useChromeConfig();
|
|
13460
13463
|
const {
|
|
13461
13464
|
viewports: viewportOptions = defaultViewports,
|
|
13462
13465
|
ui: uiProp,
|
|
@@ -13639,12 +13642,7 @@ var Canvas = () => {
|
|
|
13639
13642
|
}
|
|
13640
13643
|
},
|
|
13641
13644
|
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getClassName37("inner"), ref: frameRef, children: [
|
|
13642
|
-
|
|
13643
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(IconButton, { type: "button", title: "Zoom out", onClick: zoomOut, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Minus, { size: 14 }) }),
|
|
13644
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(IconButton, { type: "button", title: "Reset zoom", onClick: resetZoom, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(RotateCcw, { size: 14 }) }),
|
|
13645
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Plus, { size: 14 }) })
|
|
13646
|
-
] }),
|
|
13647
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(
|
|
13645
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13648
13646
|
"div",
|
|
13649
13647
|
{
|
|
13650
13648
|
className: getClassName37("rootColumn"),
|
|
@@ -13654,40 +13652,76 @@ var Canvas = () => {
|
|
|
13654
13652
|
transformOrigin: disableZoomControls ? void 0 : "center center",
|
|
13655
13653
|
transition: showTransition ? `width ${TRANSITION_DURATION}ms ease-out, transform ${TRANSITION_DURATION}ms ease-out` : disableZoomControls ? void 0 : "transform 150ms ease-out"
|
|
13656
13654
|
},
|
|
13657
|
-
children:
|
|
13658
|
-
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
viewports: __spreadProps(__spreadValues({}, viewports), { current: uiViewport })
|
|
13671
|
-
});
|
|
13672
|
-
}
|
|
13673
|
-
}
|
|
13674
|
-
) }),
|
|
13675
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13676
|
-
"div",
|
|
13677
|
-
{
|
|
13678
|
-
className: getClassName37("root"),
|
|
13679
|
-
suppressHydrationWarning: true,
|
|
13680
|
-
id: "editor-canvas-root",
|
|
13681
|
-
onTransitionEnd: () => {
|
|
13682
|
-
setShowTransition(false);
|
|
13683
|
-
isResizingRef.current = false;
|
|
13684
|
-
},
|
|
13685
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Preview2, {}) })
|
|
13686
|
-
}
|
|
13687
|
-
)
|
|
13688
|
-
]
|
|
13655
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13656
|
+
"div",
|
|
13657
|
+
{
|
|
13658
|
+
className: getClassName37("root"),
|
|
13659
|
+
suppressHydrationWarning: true,
|
|
13660
|
+
id: "editor-canvas-root",
|
|
13661
|
+
onTransitionEnd: () => {
|
|
13662
|
+
setShowTransition(false);
|
|
13663
|
+
isResizingRef.current = false;
|
|
13664
|
+
},
|
|
13665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(CustomPreview, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Preview2, {}) })
|
|
13666
|
+
}
|
|
13667
|
+
)
|
|
13689
13668
|
}
|
|
13690
13669
|
),
|
|
13670
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getClassName37("bottomBar"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: getClassName37("bottomBarPill"), children: [
|
|
13671
|
+
chrome.showThemeToggle && onToggleTheme && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13672
|
+
IconButton,
|
|
13673
|
+
{
|
|
13674
|
+
type: "button",
|
|
13675
|
+
title: themeLabel != null ? themeLabel : "Toggle theme",
|
|
13676
|
+
onClick: onToggleTheme,
|
|
13677
|
+
children: themeIcon
|
|
13678
|
+
}
|
|
13679
|
+
),
|
|
13680
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13681
|
+
DeviceToggle,
|
|
13682
|
+
{
|
|
13683
|
+
onViewportChange: (viewport) => {
|
|
13684
|
+
autoSelectingRef.current = false;
|
|
13685
|
+
setShowTransition(true);
|
|
13686
|
+
isResizingRef.current = true;
|
|
13687
|
+
const uiViewport = __spreadProps(__spreadValues({}, viewport), {
|
|
13688
|
+
height: viewport.height || "auto",
|
|
13689
|
+
zoom: 1
|
|
13690
|
+
});
|
|
13691
|
+
setUi({
|
|
13692
|
+
viewports: __spreadProps(__spreadValues({}, viewports), { current: uiViewport })
|
|
13693
|
+
});
|
|
13694
|
+
}
|
|
13695
|
+
}
|
|
13696
|
+
),
|
|
13697
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(FullScreenToggle, {}),
|
|
13698
|
+
!disableZoomControls && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(import_jsx_runtime86.Fragment, { children: [
|
|
13699
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: getClassName37("bottomBarDivider") }),
|
|
13700
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13701
|
+
IconButton,
|
|
13702
|
+
{
|
|
13703
|
+
type: "button",
|
|
13704
|
+
title: "Zoom out",
|
|
13705
|
+
onClick: zoomOut,
|
|
13706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Minus, { size: 14 })
|
|
13707
|
+
}
|
|
13708
|
+
),
|
|
13709
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("span", { className: getClassName37("zoomLevel"), children: [
|
|
13710
|
+
Math.round(canvasZoom * 100),
|
|
13711
|
+
"%"
|
|
13712
|
+
] }),
|
|
13713
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(IconButton, { type: "button", title: "Zoom in", onClick: zoomIn, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Plus, { size: 14 }) }),
|
|
13714
|
+
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
13715
|
+
IconButton,
|
|
13716
|
+
{
|
|
13717
|
+
type: "button",
|
|
13718
|
+
title: "Reset zoom",
|
|
13719
|
+
onClick: resetZoom,
|
|
13720
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(RotateCcw, { size: 14 })
|
|
13721
|
+
}
|
|
13722
|
+
)
|
|
13723
|
+
] })
|
|
13724
|
+
] }) }),
|
|
13691
13725
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: getClassName37("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(Loader, { size: 24 }) })
|
|
13692
13726
|
] })
|
|
13693
13727
|
}
|
|
@@ -14056,51 +14090,6 @@ var useClipboardHotkeys = () => {
|
|
|
14056
14090
|
useHotkey({ ctrl: true, x: true }, cutSelectedComponent);
|
|
14057
14091
|
};
|
|
14058
14092
|
|
|
14059
|
-
// components/Editor/components/Nav/index.tsx
|
|
14060
|
-
init_react_import();
|
|
14061
|
-
|
|
14062
|
-
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Editor/components/Nav/styles.module.css#css-module
|
|
14063
|
-
init_react_import();
|
|
14064
|
-
var styles_module_default33 = { "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" };
|
|
14065
|
-
|
|
14066
|
-
// components/Editor/components/Nav/index.tsx
|
|
14067
|
-
init_lib();
|
|
14068
|
-
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
14069
|
-
var getClassName40 = get_class_name_factory_default("Nav", styles_module_default33);
|
|
14070
|
-
var getClassNameItem3 = get_class_name_factory_default("NavItem", styles_module_default33);
|
|
14071
|
-
var MenuItem = ({
|
|
14072
|
-
label,
|
|
14073
|
-
icon,
|
|
14074
|
-
onClick,
|
|
14075
|
-
isActive,
|
|
14076
|
-
mobileOnly,
|
|
14077
|
-
desktopOnly
|
|
14078
|
-
}) => {
|
|
14079
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
14080
|
-
"li",
|
|
14081
|
-
{
|
|
14082
|
-
className: getClassNameItem3({
|
|
14083
|
-
active: isActive,
|
|
14084
|
-
mobileOnly,
|
|
14085
|
-
desktopOnly
|
|
14086
|
-
}),
|
|
14087
|
-
children: onClick && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: getClassNameItem3("link"), onClick, children: [
|
|
14088
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: getClassNameItem3("linkIcon"), children: icon }),
|
|
14089
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: getClassNameItem3("linkLabel"), children: label })
|
|
14090
|
-
] })
|
|
14091
|
-
}
|
|
14092
|
-
);
|
|
14093
|
-
};
|
|
14094
|
-
var Nav = ({
|
|
14095
|
-
items,
|
|
14096
|
-
footer
|
|
14097
|
-
}) => {
|
|
14098
|
-
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("nav", { className: getClassName40(), children: [
|
|
14099
|
-
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("ul", { className: getClassName40("list"), children: Object.entries(items).map(([key, item]) => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(MenuItem, __spreadValues({}, item), key)) }),
|
|
14100
|
-
footer && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: getClassName40("footer"), children: footer })
|
|
14101
|
-
] });
|
|
14102
|
-
};
|
|
14103
|
-
|
|
14104
14093
|
// components/Editor/components/Layout/index.tsx
|
|
14105
14094
|
init_IconButton2();
|
|
14106
14095
|
init_lucide_react();
|
|
@@ -14111,17 +14100,17 @@ init_lucide_react();
|
|
|
14111
14100
|
|
|
14112
14101
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/blocks/styles.module.css#css-module
|
|
14113
14102
|
init_react_import();
|
|
14114
|
-
var
|
|
14103
|
+
var styles_module_default33 = { "BlocksPlugin": "_BlocksPlugin_15ud0_1" };
|
|
14115
14104
|
|
|
14116
14105
|
// plugins/blocks/index.tsx
|
|
14117
14106
|
init_lib();
|
|
14118
|
-
var
|
|
14119
|
-
var
|
|
14107
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
14108
|
+
var getClassName40 = get_class_name_factory_default("BlocksPlugin", styles_module_default33);
|
|
14120
14109
|
var blocksPlugin = () => ({
|
|
14121
14110
|
name: "blocks",
|
|
14122
14111
|
label: "Blocks",
|
|
14123
|
-
render: () => /* @__PURE__ */ (0,
|
|
14124
|
-
icon: /* @__PURE__ */ (0,
|
|
14112
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: getClassName40(), children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Components, {}) }),
|
|
14113
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Plus, {})
|
|
14125
14114
|
});
|
|
14126
14115
|
|
|
14127
14116
|
// plugins/fields/index.tsx
|
|
@@ -14131,12 +14120,12 @@ init_store();
|
|
|
14131
14120
|
|
|
14132
14121
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
|
|
14133
14122
|
init_react_import();
|
|
14134
|
-
var
|
|
14123
|
+
var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
|
|
14135
14124
|
|
|
14136
14125
|
// plugins/fields/index.tsx
|
|
14137
14126
|
init_lib();
|
|
14138
|
-
var
|
|
14139
|
-
var
|
|
14127
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
14128
|
+
var getClassName41 = get_class_name_factory_default("FieldsPlugin", styles_module_default34);
|
|
14140
14129
|
var CurrentTitle = () => {
|
|
14141
14130
|
const label = useAppStore((s) => {
|
|
14142
14131
|
var _a, _b;
|
|
@@ -14148,20 +14137,23 @@ var CurrentTitle = () => {
|
|
|
14148
14137
|
var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
|
|
14149
14138
|
name: "fields",
|
|
14150
14139
|
label: "Fields",
|
|
14151
|
-
render: () => /* @__PURE__ */ (0,
|
|
14152
|
-
/* @__PURE__ */ (0,
|
|
14153
|
-
/* @__PURE__ */ (0,
|
|
14140
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: getClassName41(), children: [
|
|
14141
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: getClassName41("header"), children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(CurrentTitle, {}) }) }),
|
|
14142
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Fields, {})
|
|
14154
14143
|
] }),
|
|
14155
|
-
icon: /* @__PURE__ */ (0,
|
|
14144
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(RectangleEllipsis, {}),
|
|
14156
14145
|
mobileOnly: desktopSideBar === "right"
|
|
14157
14146
|
});
|
|
14158
14147
|
|
|
14159
14148
|
// components/Editor/components/Layout/index.tsx
|
|
14160
|
-
var
|
|
14161
|
-
var
|
|
14149
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
14150
|
+
var getClassName42 = get_class_name_factory_default("Editor", styles_module_default25);
|
|
14162
14151
|
var getLayoutClassName = get_class_name_factory_default("EditorLayout", styles_module_default25);
|
|
14163
14152
|
var getPluginTabClassName = get_class_name_factory_default("EditorPluginTab", styles_module_default25);
|
|
14164
|
-
var
|
|
14153
|
+
var getHeaderClassName = get_class_name_factory_default("EditorHeader", styles_module_default25);
|
|
14154
|
+
var TopHeader = ({
|
|
14155
|
+
pluginItems
|
|
14156
|
+
}) => {
|
|
14165
14157
|
const appStore = useAppStoreApi();
|
|
14166
14158
|
const { onPublish, currentRoute } = usePropsContext();
|
|
14167
14159
|
const chrome = useChromeConfig();
|
|
@@ -14172,39 +14164,62 @@ var FieldSideBarToolbar = () => {
|
|
|
14172
14164
|
const CustomHeaderActions = useAppStore(
|
|
14173
14165
|
(s) => s.overrides.headerActions || DefaultOverride
|
|
14174
14166
|
);
|
|
14175
|
-
return /* @__PURE__ */ (0,
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
{
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("header", { className: getHeaderClassName(), children: [
|
|
14168
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getHeaderClassName("plugins"), children: Object.entries(pluginItems).map(([key, item]) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14169
|
+
"span",
|
|
14170
|
+
{
|
|
14171
|
+
className: getHeaderClassName("pluginItem", {
|
|
14172
|
+
mobileOnly: item.mobileOnly,
|
|
14173
|
+
desktopOnly: item.desktopOnly
|
|
14174
|
+
}),
|
|
14175
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14176
|
+
IconButton,
|
|
14177
|
+
{
|
|
14178
|
+
type: "button",
|
|
14179
|
+
title: item.label,
|
|
14180
|
+
onClick: item.onClick,
|
|
14181
|
+
active: item.isActive,
|
|
14182
|
+
children: item.icon
|
|
14183
|
+
}
|
|
14184
|
+
)
|
|
14185
|
+
},
|
|
14186
|
+
key
|
|
14187
|
+
)) }),
|
|
14188
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getHeaderClassName("urlBarSlot"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UrlBar, {}) }),
|
|
14189
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getHeaderClassName("actions"), children: [
|
|
14190
|
+
chrome.showHistoryControls && /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getHeaderClassName("history"), children: [
|
|
14191
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14192
|
+
IconButton,
|
|
14193
|
+
{
|
|
14194
|
+
type: "button",
|
|
14195
|
+
title: "undo",
|
|
14196
|
+
disabled: !hasPast,
|
|
14197
|
+
onClick: back,
|
|
14198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Undo2, { size: 18 })
|
|
14199
|
+
}
|
|
14200
|
+
),
|
|
14201
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14202
|
+
IconButton,
|
|
14203
|
+
{
|
|
14204
|
+
type: "button",
|
|
14205
|
+
title: "redo",
|
|
14206
|
+
disabled: !hasFuture,
|
|
14207
|
+
onClick: forward,
|
|
14208
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Redo2, { size: 18 })
|
|
14209
|
+
}
|
|
14210
|
+
)
|
|
14211
|
+
] }),
|
|
14212
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14213
|
+
Button,
|
|
14189
14214
|
{
|
|
14190
|
-
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
children:
|
|
14215
|
+
onClick: () => {
|
|
14216
|
+
const data = appStore.getState().state.data;
|
|
14217
|
+
onPublish && onPublish(data, currentRoute);
|
|
14218
|
+
},
|
|
14219
|
+
children: "Publish"
|
|
14195
14220
|
}
|
|
14196
|
-
)
|
|
14197
|
-
] })
|
|
14198
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassName43("fieldSideBarActions"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14199
|
-
Button,
|
|
14200
|
-
{
|
|
14201
|
-
onClick: () => {
|
|
14202
|
-
const data = appStore.getState().state.data;
|
|
14203
|
-
onPublish && onPublish(data, currentRoute);
|
|
14204
|
-
},
|
|
14205
|
-
children: "Publish"
|
|
14206
|
-
}
|
|
14207
|
-
) }) })
|
|
14221
|
+
) })
|
|
14222
|
+
] })
|
|
14208
14223
|
] });
|
|
14209
14224
|
};
|
|
14210
14225
|
var FieldSideBar = () => {
|
|
@@ -14214,17 +14229,14 @@ var FieldSideBar = () => {
|
|
|
14214
14229
|
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";
|
|
14215
14230
|
}
|
|
14216
14231
|
);
|
|
14217
|
-
return /* @__PURE__ */ (0,
|
|
14218
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FieldSideBarToolbar, {}),
|
|
14219
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {}) })
|
|
14220
|
-
] });
|
|
14232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Fields, {}) });
|
|
14221
14233
|
};
|
|
14222
14234
|
var PluginTab = ({
|
|
14223
14235
|
children,
|
|
14224
14236
|
visible,
|
|
14225
14237
|
mobileOnly
|
|
14226
14238
|
}) => {
|
|
14227
|
-
return /* @__PURE__ */ (0,
|
|
14239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getPluginTabClassName("body"), children }) });
|
|
14228
14240
|
};
|
|
14229
14241
|
var Layout = ({ children }) => {
|
|
14230
14242
|
const {
|
|
@@ -14393,7 +14405,7 @@ var Layout = ({ children }) => {
|
|
|
14393
14405
|
const toggleTheme = () => {
|
|
14394
14406
|
setTheme((t) => t === "dark" ? "light" : "dark");
|
|
14395
14407
|
};
|
|
14396
|
-
const themeIcon = theme === "dark" ? /* @__PURE__ */ (0,
|
|
14408
|
+
const themeIcon = theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Sun, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Moon, { size: 14 });
|
|
14397
14409
|
const themeLabel = theme === "dark" ? "Switch to light mode" : "Switch to dark mode";
|
|
14398
14410
|
const hasLegacySideBarPlugin = (0, import_react94.useMemo)(
|
|
14399
14411
|
() => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
|
|
@@ -14418,7 +14430,7 @@ var Layout = ({ children }) => {
|
|
|
14418
14430
|
}
|
|
14419
14431
|
details[plugin.name] = {
|
|
14420
14432
|
label: (_a = plugin.label) != null ? _a : plugin.name,
|
|
14421
|
-
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0,
|
|
14433
|
+
icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ToyBrick, {}),
|
|
14422
14434
|
onClick: () => {
|
|
14423
14435
|
var _a2;
|
|
14424
14436
|
setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
|
|
@@ -14457,17 +14469,17 @@ var Layout = ({ children }) => {
|
|
|
14457
14469
|
if (mobilePanelHeight && leftSideBarVisible) {
|
|
14458
14470
|
mobilePanelStyle["--editor-mobile-panel-height"] = `${mobilePanelHeight}px`;
|
|
14459
14471
|
}
|
|
14460
|
-
return /* @__PURE__ */ (0,
|
|
14472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
14461
14473
|
"div",
|
|
14462
14474
|
{
|
|
14463
|
-
className: `Editor ${
|
|
14475
|
+
className: `Editor ${getClassName42({
|
|
14464
14476
|
hidePlugins: hasLegacySideBarPlugin
|
|
14465
14477
|
})}`,
|
|
14466
14478
|
id: instanceId,
|
|
14467
14479
|
"data-theme": theme,
|
|
14468
14480
|
style: { height },
|
|
14469
14481
|
children: [
|
|
14470
|
-
/* @__PURE__ */ (0,
|
|
14482
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CustomEditor, { children: children || /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14471
14483
|
"div",
|
|
14472
14484
|
{
|
|
14473
14485
|
className: getLayoutClassName({
|
|
@@ -14480,40 +14492,26 @@ var Layout = ({ children }) => {
|
|
|
14480
14492
|
mobilePanelCustomHeight: mobilePanelHeight !== null && leftSideBarVisible
|
|
14481
14493
|
}),
|
|
14482
14494
|
style: { height },
|
|
14483
|
-
children: /* @__PURE__ */ (0,
|
|
14495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
14484
14496
|
"div",
|
|
14485
14497
|
{
|
|
14486
14498
|
className: getLayoutClassName("inner"),
|
|
14487
14499
|
style: __spreadValues(__spreadValues({}, layoutOptions), mobilePanelStyle),
|
|
14488
14500
|
children: [
|
|
14489
|
-
navBarVisible && /* @__PURE__ */ (0,
|
|
14490
|
-
|
|
14491
|
-
{
|
|
14492
|
-
items: pluginItems,
|
|
14493
|
-
footer: chrome.showThemeToggle ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
14494
|
-
IconButton,
|
|
14495
|
-
{
|
|
14496
|
-
type: "button",
|
|
14497
|
-
title: themeLabel,
|
|
14498
|
-
onClick: toggleTheme,
|
|
14499
|
-
children: themeIcon
|
|
14500
|
-
}
|
|
14501
|
-
) : void 0
|
|
14502
|
-
}
|
|
14503
|
-
) }),
|
|
14504
|
-
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
14501
|
+
navBarVisible && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getLayoutClassName("header"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(TopHeader, { pluginItems }) }),
|
|
14502
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(
|
|
14505
14503
|
"div",
|
|
14506
14504
|
{
|
|
14507
14505
|
ref: mobilePanelRef,
|
|
14508
14506
|
className: getLayoutClassName("mobilePanel"),
|
|
14509
14507
|
children: [
|
|
14510
|
-
/* @__PURE__ */ (0,
|
|
14508
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14511
14509
|
"div",
|
|
14512
14510
|
{
|
|
14513
14511
|
className: getLayoutClassName("mobileDragHandle"),
|
|
14514
14512
|
onTouchStart: (e) => handleMobileDragStart(e.touches[0].clientY),
|
|
14515
14513
|
onMouseDown: (e) => handleMobileDragStart(e.clientY),
|
|
14516
|
-
children: /* @__PURE__ */ (0,
|
|
14514
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14517
14515
|
"div",
|
|
14518
14516
|
{
|
|
14519
14517
|
className: getLayoutClassName("mobileDragHandlePill")
|
|
@@ -14521,17 +14519,17 @@ var Layout = ({ children }) => {
|
|
|
14521
14519
|
)
|
|
14522
14520
|
}
|
|
14523
14521
|
),
|
|
14524
|
-
/* @__PURE__ */ (0,
|
|
14522
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14525
14523
|
"div",
|
|
14526
14524
|
{
|
|
14527
14525
|
className: getLayoutClassName("mobilePanelContent"),
|
|
14528
14526
|
children: Object.entries(pluginItems).map(
|
|
14529
|
-
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0,
|
|
14527
|
+
([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14530
14528
|
PluginTab,
|
|
14531
14529
|
{
|
|
14532
14530
|
visible: currentPlugin === id,
|
|
14533
14531
|
mobileOnly,
|
|
14534
|
-
children: /* @__PURE__ */ (0,
|
|
14532
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Render2, {})
|
|
14535
14533
|
},
|
|
14536
14534
|
id
|
|
14537
14535
|
)
|
|
@@ -14541,7 +14539,7 @@ var Layout = ({ children }) => {
|
|
|
14541
14539
|
]
|
|
14542
14540
|
}
|
|
14543
14541
|
),
|
|
14544
|
-
/* @__PURE__ */ (0,
|
|
14542
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14545
14543
|
Sidebar,
|
|
14546
14544
|
{
|
|
14547
14545
|
position: "left",
|
|
@@ -14550,20 +14548,28 @@ var Layout = ({ children }) => {
|
|
|
14550
14548
|
onResize: setLeftWidth,
|
|
14551
14549
|
onResizeEnd: handleLeftSidebarResizeEnd,
|
|
14552
14550
|
children: Object.entries(pluginItems).map(
|
|
14553
|
-
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0,
|
|
14551
|
+
([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14554
14552
|
PluginTab,
|
|
14555
14553
|
{
|
|
14556
14554
|
visible: currentPlugin === id,
|
|
14557
14555
|
mobileOnly,
|
|
14558
|
-
children: /* @__PURE__ */ (0,
|
|
14556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Render2, {})
|
|
14559
14557
|
},
|
|
14560
14558
|
id
|
|
14561
14559
|
)
|
|
14562
14560
|
)
|
|
14563
14561
|
}
|
|
14564
14562
|
),
|
|
14565
|
-
/* @__PURE__ */ (0,
|
|
14566
|
-
|
|
14563
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14564
|
+
Canvas,
|
|
14565
|
+
{
|
|
14566
|
+
theme,
|
|
14567
|
+
themeIcon,
|
|
14568
|
+
themeLabel,
|
|
14569
|
+
onToggleTheme: toggleTheme
|
|
14570
|
+
}
|
|
14571
|
+
),
|
|
14572
|
+
!hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
14567
14573
|
Sidebar,
|
|
14568
14574
|
{
|
|
14569
14575
|
position: "right",
|
|
@@ -14571,7 +14577,7 @@ var Layout = ({ children }) => {
|
|
|
14571
14577
|
isVisible: rightSideBarVisible,
|
|
14572
14578
|
onResize: setRightWidth,
|
|
14573
14579
|
onResizeEnd: handleRightSidebarResizeEnd,
|
|
14574
|
-
children: /* @__PURE__ */ (0,
|
|
14580
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(FieldSideBar, {})
|
|
14575
14581
|
}
|
|
14576
14582
|
)
|
|
14577
14583
|
]
|
|
@@ -14579,14 +14585,14 @@ var Layout = ({ children }) => {
|
|
|
14579
14585
|
)
|
|
14580
14586
|
}
|
|
14581
14587
|
) }) }) }),
|
|
14582
|
-
/* @__PURE__ */ (0,
|
|
14588
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { id: "editor-portal-root", className: getClassName42("portal") })
|
|
14583
14589
|
]
|
|
14584
14590
|
}
|
|
14585
14591
|
);
|
|
14586
14592
|
};
|
|
14587
14593
|
|
|
14588
14594
|
// components/Editor/index.tsx
|
|
14589
|
-
var
|
|
14595
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
14590
14596
|
var CHROME_KEYS = [
|
|
14591
14597
|
"showNavBar",
|
|
14592
14598
|
"showThemeToggle",
|
|
@@ -14618,7 +14624,7 @@ var splitUiConfig = (ui) => {
|
|
|
14618
14624
|
};
|
|
14619
14625
|
var propsContext = (0, import_react95.createContext)({});
|
|
14620
14626
|
function PropsProvider(props) {
|
|
14621
|
-
return /* @__PURE__ */ (0,
|
|
14627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(propsContext.Provider, { value: props, children: props.children });
|
|
14622
14628
|
}
|
|
14623
14629
|
var usePropsContext = () => (0, import_react95.useContext)(propsContext);
|
|
14624
14630
|
var useChromeConfig = () => {
|
|
@@ -14808,10 +14814,10 @@ function EditorProvider({ children }) {
|
|
|
14808
14814
|
resolveAndCommitData();
|
|
14809
14815
|
}, 0);
|
|
14810
14816
|
}, []);
|
|
14811
|
-
return /* @__PURE__ */ (0,
|
|
14817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
|
|
14812
14818
|
}
|
|
14813
14819
|
function Editor4(props) {
|
|
14814
|
-
return /* @__PURE__ */ (0,
|
|
14820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Layout, { children: props.children }) })) }));
|
|
14815
14821
|
}
|
|
14816
14822
|
Editor4.Components = Components;
|
|
14817
14823
|
Editor4.Fields = Fields;
|
|
@@ -14893,7 +14899,7 @@ var useApp = () => {
|
|
|
14893
14899
|
};
|
|
14894
14900
|
|
|
14895
14901
|
// components/App/AppProvider.tsx
|
|
14896
|
-
var
|
|
14902
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
14897
14903
|
var EDITOR_PATH = "/editor";
|
|
14898
14904
|
var isServer = typeof window === "undefined";
|
|
14899
14905
|
function AppProvider({
|
|
@@ -14914,26 +14920,26 @@ function AppProvider({
|
|
|
14914
14920
|
}),
|
|
14915
14921
|
[config, stablePages, resolvedEditorPath]
|
|
14916
14922
|
);
|
|
14917
|
-
const inner = /* @__PURE__ */ (0,
|
|
14923
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(appConfigContext.Provider, { value: ctxValue, children });
|
|
14918
14924
|
if (isServer) {
|
|
14919
|
-
return /* @__PURE__ */ (0,
|
|
14925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_router2.StaticRouter, { location: currentPath != null ? currentPath : "/", children: inner });
|
|
14920
14926
|
}
|
|
14921
14927
|
if (router === "hash") {
|
|
14922
|
-
return /* @__PURE__ */ (0,
|
|
14928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_router2.HashRouter, { children: inner });
|
|
14923
14929
|
}
|
|
14924
14930
|
if (router === "memory") {
|
|
14925
|
-
return /* @__PURE__ */ (0,
|
|
14931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_router2.MemoryRouter, { initialEntries: [currentPath != null ? currentPath : "/"], children: inner });
|
|
14926
14932
|
}
|
|
14927
|
-
return /* @__PURE__ */ (0,
|
|
14933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_router2.BrowserRouter, { children: inner });
|
|
14928
14934
|
}
|
|
14929
14935
|
|
|
14930
14936
|
// components/App/App.tsx
|
|
14931
|
-
var
|
|
14937
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
14932
14938
|
var joinEditorPath = (editorPath, route) => {
|
|
14933
14939
|
if (route === "/") return editorPath;
|
|
14934
14940
|
return `${editorPath}${route}`;
|
|
14935
14941
|
};
|
|
14936
|
-
var DefaultNotFound = () => /* @__PURE__ */ (0,
|
|
14942
|
+
var DefaultNotFound = () => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14937
14943
|
"div",
|
|
14938
14944
|
{
|
|
14939
14945
|
style: {
|
|
@@ -14943,9 +14949,9 @@ var DefaultNotFound = () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
|
14943
14949
|
justifyContent: "center",
|
|
14944
14950
|
alignItems: "center"
|
|
14945
14951
|
},
|
|
14946
|
-
children: /* @__PURE__ */ (0,
|
|
14947
|
-
/* @__PURE__ */ (0,
|
|
14948
|
-
/* @__PURE__ */ (0,
|
|
14952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { children: [
|
|
14953
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("h1", { children: "404" }),
|
|
14954
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { children: "No page matches this route." })
|
|
14949
14955
|
] })
|
|
14950
14956
|
}
|
|
14951
14957
|
);
|
|
@@ -14956,7 +14962,7 @@ function RenderForKey({
|
|
|
14956
14962
|
const { config, pages } = useApp();
|
|
14957
14963
|
const data = pages[routeKey];
|
|
14958
14964
|
if (!data) return null;
|
|
14959
|
-
return /* @__PURE__ */ (0,
|
|
14965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14960
14966
|
Render,
|
|
14961
14967
|
{
|
|
14962
14968
|
config,
|
|
@@ -14974,7 +14980,7 @@ function EditorForKey({
|
|
|
14974
14980
|
const { config, pages, routes, navigate } = useApp();
|
|
14975
14981
|
const data = pages[routeKey];
|
|
14976
14982
|
if (!data) return null;
|
|
14977
|
-
return /* @__PURE__ */ (0,
|
|
14983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
14978
14984
|
Editor4,
|
|
14979
14985
|
{
|
|
14980
14986
|
config,
|
|
@@ -15011,12 +15017,12 @@ function AppRender({ metadata, renderNotFound }) {
|
|
|
15011
15017
|
const { pages, isEditing } = useApp();
|
|
15012
15018
|
if (isEditing) return null;
|
|
15013
15019
|
const routeKeys = Object.keys(pages);
|
|
15014
|
-
return /* @__PURE__ */ (0,
|
|
15015
|
-
routeKeys.map((routeKey) => /* @__PURE__ */ (0,
|
|
15020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_react_router3.Routes, { children: [
|
|
15021
|
+
routeKeys.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15016
15022
|
import_react_router3.Route,
|
|
15017
15023
|
{
|
|
15018
15024
|
path: routeKey,
|
|
15019
|
-
element: /* @__PURE__ */ (0,
|
|
15025
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15020
15026
|
RenderForKey,
|
|
15021
15027
|
{
|
|
15022
15028
|
routeKey,
|
|
@@ -15026,11 +15032,11 @@ function AppRender({ metadata, renderNotFound }) {
|
|
|
15026
15032
|
},
|
|
15027
15033
|
`render:${routeKey}`
|
|
15028
15034
|
)),
|
|
15029
|
-
/* @__PURE__ */ (0,
|
|
15035
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15030
15036
|
import_react_router3.Route,
|
|
15031
15037
|
{
|
|
15032
15038
|
path: "*",
|
|
15033
|
-
element: renderNotFound ? /* @__PURE__ */ (0,
|
|
15039
|
+
element: renderNotFound ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_jsx_runtime94.Fragment, { children: renderNotFound() }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DefaultNotFound, {})
|
|
15034
15040
|
}
|
|
15035
15041
|
)
|
|
15036
15042
|
] });
|
|
@@ -15040,12 +15046,12 @@ function AppEditor(props) {
|
|
|
15040
15046
|
const { pages, isEditing, editorPath } = useApp();
|
|
15041
15047
|
if (!isEditing || editorPath === null) return null;
|
|
15042
15048
|
const routeKeys = Object.keys(pages);
|
|
15043
|
-
return /* @__PURE__ */ (0,
|
|
15044
|
-
routeKeys.map((routeKey) => /* @__PURE__ */ (0,
|
|
15049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_react_router3.Routes, { children: [
|
|
15050
|
+
routeKeys.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15045
15051
|
import_react_router3.Route,
|
|
15046
15052
|
{
|
|
15047
15053
|
path: joinEditorPath(editorPath, routeKey),
|
|
15048
|
-
element: /* @__PURE__ */ (0,
|
|
15054
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15049
15055
|
EditorForKey,
|
|
15050
15056
|
{
|
|
15051
15057
|
routeKey,
|
|
@@ -15056,26 +15062,26 @@ function AppEditor(props) {
|
|
|
15056
15062
|
},
|
|
15057
15063
|
`edit:${routeKey}`
|
|
15058
15064
|
)),
|
|
15059
|
-
/* @__PURE__ */ (0,
|
|
15065
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15060
15066
|
import_react_router3.Route,
|
|
15061
15067
|
{
|
|
15062
15068
|
path: "*",
|
|
15063
|
-
element: renderNotFound ? /* @__PURE__ */ (0,
|
|
15069
|
+
element: renderNotFound ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_jsx_runtime94.Fragment, { children: renderNotFound() }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DefaultNotFound, {})
|
|
15064
15070
|
}
|
|
15065
15071
|
)
|
|
15066
15072
|
] });
|
|
15067
15073
|
}
|
|
15068
15074
|
function DefaultAppLayout(props) {
|
|
15069
15075
|
const _a = props, { renderNotFound } = _a, editorProps = __objRest(_a, ["renderNotFound"]);
|
|
15070
|
-
return /* @__PURE__ */ (0,
|
|
15071
|
-
/* @__PURE__ */ (0,
|
|
15076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
|
|
15077
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15072
15078
|
AppRender,
|
|
15073
15079
|
{
|
|
15074
15080
|
metadata: editorProps.metadata,
|
|
15075
15081
|
renderNotFound
|
|
15076
15082
|
}
|
|
15077
15083
|
),
|
|
15078
|
-
/* @__PURE__ */ (0,
|
|
15084
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(AppEditor, __spreadProps(__spreadValues({}, editorProps), { renderNotFound }))
|
|
15079
15085
|
] });
|
|
15080
15086
|
}
|
|
15081
15087
|
function App(props) {
|
|
@@ -15094,7 +15100,7 @@ function App(props) {
|
|
|
15094
15100
|
"router",
|
|
15095
15101
|
"children"
|
|
15096
15102
|
]);
|
|
15097
|
-
return /* @__PURE__ */ (0,
|
|
15103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
15098
15104
|
AppProvider,
|
|
15099
15105
|
{
|
|
15100
15106
|
config,
|
|
@@ -15102,7 +15108,7 @@ function App(props) {
|
|
|
15102
15108
|
currentPath,
|
|
15103
15109
|
editorPath,
|
|
15104
15110
|
router,
|
|
15105
|
-
children: children != null ? children : /* @__PURE__ */ (0,
|
|
15111
|
+
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(DefaultAppLayout, __spreadValues({}, layoutProps))
|
|
15106
15112
|
}
|
|
15107
15113
|
);
|
|
15108
15114
|
}
|
|
@@ -15441,27 +15447,27 @@ init_lucide_react();
|
|
|
15441
15447
|
|
|
15442
15448
|
// css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
|
|
15443
15449
|
init_react_import();
|
|
15444
|
-
var
|
|
15450
|
+
var styles_module_default35 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
|
|
15445
15451
|
|
|
15446
15452
|
// plugins/outline/index.tsx
|
|
15447
15453
|
init_lib();
|
|
15448
|
-
var
|
|
15449
|
-
var
|
|
15454
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
15455
|
+
var getClassName43 = get_class_name_factory_default("OutlinePlugin", styles_module_default35);
|
|
15450
15456
|
var outlinePlugin = () => ({
|
|
15451
15457
|
name: "outline",
|
|
15452
15458
|
label: "Outline",
|
|
15453
|
-
render: () => /* @__PURE__ */ (0,
|
|
15454
|
-
icon: /* @__PURE__ */ (0,
|
|
15459
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: getClassName43(), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Outline, {}) }),
|
|
15460
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Layers, {})
|
|
15455
15461
|
});
|
|
15456
15462
|
|
|
15457
15463
|
// plugins/legacy-side-bar/index.tsx
|
|
15458
15464
|
init_react_import();
|
|
15459
|
-
var
|
|
15465
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
15460
15466
|
var legacySideBarPlugin = () => ({
|
|
15461
15467
|
name: "legacy-side-bar",
|
|
15462
|
-
render: () => /* @__PURE__ */ (0,
|
|
15463
|
-
/* @__PURE__ */ (0,
|
|
15464
|
-
/* @__PURE__ */ (0,
|
|
15468
|
+
render: () => /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { style: { overflowY: "auto" }, children: [
|
|
15469
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(SidebarSection, { title: "Components", noBorderTop: true, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Components, {}) }),
|
|
15470
|
+
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)(SidebarSection, { title: "Outline", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Outline, {}) })
|
|
15465
15471
|
] })
|
|
15466
15472
|
});
|
|
15467
15473
|
// Annotate the CommonJS export names for ESM import in node:
|