@reacteditor/core 0.0.10 → 0.0.11

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.
Files changed (38) hide show
  1. package/README.md +7 -7
  2. package/dist/{Editor-3COFH5WN.mjs → Editor-GK6JTUPD.mjs} +7 -7
  3. package/dist/{actions-B8_EA7vy.d.mts → actions-C0LX6bI4.d.mts} +1 -0
  4. package/dist/{actions-B8_EA7vy.d.ts → actions-C0LX6bI4.d.ts} +1 -0
  5. package/dist/{chunk-LRFRIIKG.mjs → chunk-56I7ST5F.mjs} +1 -1
  6. package/dist/{chunk-3IP22OOD.mjs → chunk-74TOLW7F.mjs} +1139 -1118
  7. package/dist/{chunk-IIRJMJFU.mjs → chunk-ERNSJXVF.mjs} +1 -0
  8. package/dist/{chunk-PUDWMFBH.mjs → chunk-II42EKFK.mjs} +1 -1
  9. package/dist/{chunk-AD7BMXAA.mjs → chunk-MJJPWASL.mjs} +1 -1
  10. package/dist/{chunk-BUR5T7IX.mjs → chunk-TGVAC3JP.mjs} +7 -7
  11. package/dist/{chunk-FT6UFK7G.mjs → chunk-X4EUZIHA.mjs} +1 -1
  12. package/dist/{chunk-OIFPBVSF.mjs → chunk-XLVEWZWT.mjs} +1 -1
  13. package/dist/{chunk-BZ4BQZJR.mjs → chunk-YBG2RYVF.mjs} +3 -3
  14. package/dist/{full-QT5KXRDP.mjs → full-IUPXFMQP.mjs} +6 -6
  15. package/dist/{index-JoD48fK_.d.mts → index-DMbFEg8G.d.mts} +1 -1
  16. package/dist/{index-BrHy0cc_.d.ts → index-DmThy7vE.d.ts} +1 -1
  17. package/dist/index.css +25 -25
  18. package/dist/index.d.mts +52 -7
  19. package/dist/index.d.ts +52 -7
  20. package/dist/index.js +155 -133
  21. package/dist/index.mjs +9 -9
  22. package/dist/internal.d.mts +2 -2
  23. package/dist/internal.d.ts +2 -2
  24. package/dist/{loaded-GLBLMTBL.mjs → loaded-BT7NIVEO.mjs} +3 -3
  25. package/dist/{loaded-O4QHGE26.mjs → loaded-HVOKDVC3.mjs} +3 -3
  26. package/dist/{loaded-R34BR6I5.mjs → loaded-YFYCF5F4.mjs} +3 -3
  27. package/dist/no-external.css +25 -25
  28. package/dist/no-external.d.mts +4 -4
  29. package/dist/no-external.d.ts +4 -4
  30. package/dist/no-external.js +155 -133
  31. package/dist/no-external.mjs +9 -9
  32. package/dist/rsc.d.mts +2 -2
  33. package/dist/rsc.d.ts +2 -2
  34. package/dist/rsc.js +1 -0
  35. package/dist/rsc.mjs +2 -2
  36. package/dist/{walk-tree-BR2XIZ0W.d.mts → walk-tree-5oDs6qOL.d.mts} +1 -1
  37. package/dist/{walk-tree-DpUJ9kDx.d.ts → walk-tree-B1q6t5Jp.d.ts} +1 -1
  38. package/package.json +4 -4
@@ -3165,6 +3165,7 @@ var init_default_app_state = __esm({
3165
3165
  ui: {
3166
3166
  leftSideBarVisible: true,
3167
3167
  rightSideBarVisible: true,
3168
+ navBarVisible: true,
3168
3169
  arrayState: {},
3169
3170
  itemSelector: null,
3170
3171
  componentList: {},
@@ -8159,7 +8160,7 @@ init_react_import();
8159
8160
 
8160
8161
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/Drawer/styles.module.css#css-module
8161
8162
  init_react_import();
8162
- var styles_module_default18 = { "Drawer": "_Drawer_146py_1", "Drawer--tile": "_Drawer--tile_146py_8", "Drawer-draggable": "_Drawer-draggable_146py_19", "Drawer-draggableBg": "_Drawer-draggableBg_146py_23", "DrawerItem-draggable": "_DrawerItem-draggable_146py_33", "DrawerItem-icon": "_DrawerItem-icon_146py_50", "DrawerItem--disabled": "_DrawerItem--disabled_146py_56", "DrawerItem": "_DrawerItem_146py_33", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_146py_66", "DrawerItem-name": "_DrawerItem-name_146py_91" };
8163
+ var styles_module_default18 = { "Drawer": "_Drawer_1h4db_1", "Drawer--tile": "_Drawer--tile_1h4db_8", "Drawer-draggable": "_Drawer-draggable_1h4db_19", "Drawer-draggableBg": "_Drawer-draggableBg_1h4db_23", "DrawerItem-draggable": "_DrawerItem-draggable_1h4db_33", "DrawerItem-icon": "_DrawerItem-icon_1h4db_50", "DrawerItem--disabled": "_DrawerItem--disabled_1h4db_56", "DrawerItem": "_DrawerItem_1h4db_33", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_1h4db_66", "DrawerItem-name": "_DrawerItem-name_1h4db_91" };
8163
8164
 
8164
8165
  // components/Drawer/index.tsx
8165
8166
  init_get_class_name_factory();
@@ -10342,15 +10343,6 @@ var DropZoneEdit = (0, import_react69.forwardRef)(
10342
10343
  }
10343
10344
  }
10344
10345
  }, [zoneType, appStoreApi]);
10345
- (0, import_react69.useEffect)(() => {
10346
- if (zoneType === "dropzone") {
10347
- if (zoneCompound !== rootDroppableId) {
10348
- console.warn(
10349
- "DropZones have been deprecated in favor of slot fields and will be removed in a future version of Editor. Please see the migration guide: https://www.frontend.co/docs/guides/migrations/dropzones-to-slots"
10350
- );
10351
- }
10352
- }
10353
- }, [zoneType]);
10354
10346
  const contentIds = (0, import_react69.useMemo)(() => {
10355
10347
  return zoneContentIds || [];
10356
10348
  }, [zoneContentIds]);
@@ -14124,25 +14116,6 @@ var blocksPlugin = () => ({
14124
14116
  icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Plus, {})
14125
14117
  });
14126
14118
 
14127
- // plugins/outline/index.tsx
14128
- init_react_import();
14129
- init_lucide_react();
14130
-
14131
- // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
14132
- init_react_import();
14133
- var styles_module_default35 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
14134
-
14135
- // plugins/outline/index.tsx
14136
- init_lib();
14137
- var import_jsx_runtime91 = require("react/jsx-runtime");
14138
- var getClassName42 = get_class_name_factory_default("OutlinePlugin", styles_module_default35);
14139
- var outlinePlugin = () => ({
14140
- name: "outline",
14141
- label: "Outline",
14142
- render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName42(), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Outline, {}) }),
14143
- icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Layers, {})
14144
- });
14145
-
14146
14119
  // plugins/fields/index.tsx
14147
14120
  init_react_import();
14148
14121
  init_lucide_react();
@@ -14150,12 +14123,12 @@ init_store();
14150
14123
 
14151
14124
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
14152
14125
  init_react_import();
14153
- var styles_module_default36 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
14126
+ var styles_module_default35 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
14154
14127
 
14155
14128
  // plugins/fields/index.tsx
14156
14129
  init_lib();
14157
- var import_jsx_runtime92 = require("react/jsx-runtime");
14158
- var getClassName43 = get_class_name_factory_default("FieldsPlugin", styles_module_default36);
14130
+ var import_jsx_runtime91 = require("react/jsx-runtime");
14131
+ var getClassName42 = get_class_name_factory_default("FieldsPlugin", styles_module_default35);
14159
14132
  var CurrentTitle = () => {
14160
14133
  const label = useAppStore((s) => {
14161
14134
  var _a, _b;
@@ -14167,17 +14140,17 @@ var CurrentTitle = () => {
14167
14140
  var fieldsPlugin = ({ desktopSideBar = "right" } = {}) => ({
14168
14141
  name: "fields",
14169
14142
  label: "Fields",
14170
- render: () => /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName43(), children: [
14171
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getClassName43("header"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CurrentTitle, {}) }) }),
14172
- /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {})
14143
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: getClassName42(), children: [
14144
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: getClassName42("header"), children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Breadcrumbs, { numParents: 2, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CurrentTitle, {}) }) }),
14145
+ /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Fields, {})
14173
14146
  ] }),
14174
- icon: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(RectangleEllipsis, {}),
14147
+ icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(RectangleEllipsis, {}),
14175
14148
  mobileOnly: desktopSideBar === "right"
14176
14149
  });
14177
14150
 
14178
14151
  // components/Editor/components/Layout/index.tsx
14179
- var import_jsx_runtime93 = require("react/jsx-runtime");
14180
- var getClassName44 = get_class_name_factory_default("Editor", styles_module_default25);
14152
+ var import_jsx_runtime92 = require("react/jsx-runtime");
14153
+ var getClassName43 = get_class_name_factory_default("Editor", styles_module_default25);
14181
14154
  var getLayoutClassName = get_class_name_factory_default("EditorLayout", styles_module_default25);
14182
14155
  var getPluginTabClassName = get_class_name_factory_default("EditorPluginTab", styles_module_default25);
14183
14156
  var FieldSideBarToolbar = () => {
@@ -14190,30 +14163,30 @@ var FieldSideBarToolbar = () => {
14190
14163
  const CustomHeaderActions = useAppStore(
14191
14164
  (s) => s.overrides.headerActions || DefaultOverride
14192
14165
  );
14193
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: getClassName44("fieldSideBarToolbar"), children: [
14194
- /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: getClassName44("fieldSideBarHistory"), children: [
14195
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14166
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName43("fieldSideBarToolbar"), children: [
14167
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { className: getClassName43("fieldSideBarHistory"), children: [
14168
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14196
14169
  IconButton,
14197
14170
  {
14198
14171
  type: "button",
14199
14172
  title: "undo",
14200
14173
  disabled: !hasPast,
14201
14174
  onClick: back,
14202
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Undo2, { size: 18 })
14175
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Undo2, { size: 18 })
14203
14176
  }
14204
14177
  ),
14205
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14178
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14206
14179
  IconButton,
14207
14180
  {
14208
14181
  type: "button",
14209
14182
  title: "redo",
14210
14183
  disabled: !hasFuture,
14211
14184
  onClick: forward,
14212
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Redo2, { size: 18 })
14185
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Redo2, { size: 18 })
14213
14186
  }
14214
14187
  )
14215
14188
  ] }),
14216
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getClassName44("fieldSideBarActions"), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CustomHeaderActions, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14189
+ /* @__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)(
14217
14190
  Button,
14218
14191
  {
14219
14192
  onClick: () => {
@@ -14232,9 +14205,9 @@ var FieldSideBar = () => {
14232
14205
  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";
14233
14206
  }
14234
14207
  );
14235
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
14236
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FieldSideBarToolbar, {}),
14237
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Fields, {}) })
14208
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
14209
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FieldSideBarToolbar, {}),
14210
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SidebarSection, { noBorderTop: true, showBreadcrumbs: true, title, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Fields, {}) })
14238
14211
  ] });
14239
14212
  };
14240
14213
  var PluginTab = ({
@@ -14242,7 +14215,7 @@ var PluginTab = ({
14242
14215
  visible,
14243
14216
  mobileOnly
14244
14217
  }) => {
14245
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getPluginTabClassName("body"), children }) });
14218
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getPluginTabClassName({ visible, mobileOnly }), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getPluginTabClassName("body"), children }) });
14246
14219
  };
14247
14220
  var Layout = ({ children }) => {
14248
14221
  const {
@@ -14265,6 +14238,7 @@ var Layout = ({ children }) => {
14265
14238
  const rightSideBarVisible = useAppStore(
14266
14239
  (s) => s.state.ui.rightSideBarVisible
14267
14240
  );
14241
+ const navBarVisible = useAppStore((s) => s.state.ui.navBarVisible);
14268
14242
  const instanceId = useAppStore((s) => s.instanceId);
14269
14243
  const {
14270
14244
  width: leftWidth,
@@ -14409,7 +14383,7 @@ var Layout = ({ children }) => {
14409
14383
  const toggleTheme = () => {
14410
14384
  setTheme((t) => t === "dark" ? "light" : "dark");
14411
14385
  };
14412
- const themeIcon = theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Sun, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Moon, { size: 18 });
14386
+ const themeIcon = theme === "dark" ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Sun, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Moon, { size: 18 });
14413
14387
  const themeLabel = theme === "dark" ? "Switch to light mode" : "Switch to dark mode";
14414
14388
  const hasLegacySideBarPlugin = (0, import_react94.useMemo)(
14415
14389
  () => !!(plugins == null ? void 0 : plugins.find((p) => p.name === "legacy-side-bar")),
@@ -14417,7 +14391,7 @@ var Layout = ({ children }) => {
14417
14391
  );
14418
14392
  const pluginItems = (0, import_react94.useMemo)(() => {
14419
14393
  const details = {};
14420
- const defaultPlugins = [blocksPlugin(), outlinePlugin()];
14394
+ const defaultPlugins = [blocksPlugin()];
14421
14395
  const isLegacy = (plugin) => plugin.name === "legacy-side-bar" ? -1 : 0;
14422
14396
  const combinedPlugins = [
14423
14397
  ...defaultPlugins,
@@ -14434,7 +14408,7 @@ var Layout = ({ children }) => {
14434
14408
  }
14435
14409
  details[plugin.name] = {
14436
14410
  label: (_a = plugin.label) != null ? _a : plugin.name,
14437
- icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ToyBrick, {}),
14411
+ icon: (_b = plugin.icon) != null ? _b : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ToyBrick, {}),
14438
14412
  onClick: () => {
14439
14413
  var _a2;
14440
14414
  setMobilePanelHeightMode((_a2 = plugin.mobilePanelHeight) != null ? _a2 : "toggle");
@@ -14473,17 +14447,17 @@ var Layout = ({ children }) => {
14473
14447
  if (mobilePanelHeight && leftSideBarVisible) {
14474
14448
  mobilePanelStyle["--editor-mobile-panel-height"] = `${mobilePanelHeight}px`;
14475
14449
  }
14476
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
14450
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
14477
14451
  "div",
14478
14452
  {
14479
- className: `Editor ${getClassName44({
14453
+ className: `Editor ${getClassName43({
14480
14454
  hidePlugins: hasLegacySideBarPlugin
14481
14455
  })}`,
14482
14456
  id: instanceId,
14483
14457
  "data-theme": theme,
14484
14458
  style: { height },
14485
14459
  children: [
14486
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CustomEditor, { children: children || /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14460
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(DragDropContext, { disableAutoScroll: dnd == null ? void 0 : dnd.disableAutoScroll, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CustomEditor, { children: children || /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FrameProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14487
14461
  "div",
14488
14462
  {
14489
14463
  className: getLayoutClassName({
@@ -14495,17 +14469,17 @@ var Layout = ({ children }) => {
14495
14469
  mobilePanelCustomHeight: mobilePanelHeight !== null && leftSideBarVisible
14496
14470
  }),
14497
14471
  style: { height },
14498
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
14472
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
14499
14473
  "div",
14500
14474
  {
14501
14475
  className: getLayoutClassName("inner"),
14502
14476
  style: __spreadValues(__spreadValues({}, layoutOptions), mobilePanelStyle),
14503
14477
  children: [
14504
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14478
+ navBarVisible && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { className: getLayoutClassName("nav"), children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14505
14479
  Nav,
14506
14480
  {
14507
14481
  items: pluginItems,
14508
- footer: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14482
+ footer: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14509
14483
  IconButton,
14510
14484
  {
14511
14485
  type: "button",
@@ -14516,19 +14490,19 @@ var Layout = ({ children }) => {
14516
14490
  )
14517
14491
  }
14518
14492
  ) }),
14519
- /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(
14493
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
14520
14494
  "div",
14521
14495
  {
14522
14496
  ref: mobilePanelRef,
14523
14497
  className: getLayoutClassName("mobilePanel"),
14524
14498
  children: [
14525
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14499
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14526
14500
  "div",
14527
14501
  {
14528
14502
  className: getLayoutClassName("mobileDragHandle"),
14529
14503
  onTouchStart: (e) => handleMobileDragStart(e.touches[0].clientY),
14530
14504
  onMouseDown: (e) => handleMobileDragStart(e.clientY),
14531
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14505
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14532
14506
  "div",
14533
14507
  {
14534
14508
  className: getLayoutClassName("mobileDragHandlePill")
@@ -14536,17 +14510,17 @@ var Layout = ({ children }) => {
14536
14510
  )
14537
14511
  }
14538
14512
  ),
14539
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14513
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14540
14514
  "div",
14541
14515
  {
14542
14516
  className: getLayoutClassName("mobilePanelContent"),
14543
14517
  children: Object.entries(pluginItems).map(
14544
- ([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14518
+ ([id, { mobileOnly, render: Render2 }]) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14545
14519
  PluginTab,
14546
14520
  {
14547
14521
  visible: currentPlugin === id,
14548
14522
  mobileOnly,
14549
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Render2, {})
14523
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Render2, {})
14550
14524
  },
14551
14525
  id
14552
14526
  )
@@ -14556,7 +14530,7 @@ var Layout = ({ children }) => {
14556
14530
  ]
14557
14531
  }
14558
14532
  ),
14559
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14533
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14560
14534
  Sidebar,
14561
14535
  {
14562
14536
  position: "left",
@@ -14565,20 +14539,20 @@ var Layout = ({ children }) => {
14565
14539
  onResize: setLeftWidth,
14566
14540
  onResizeEnd: handleLeftSidebarResizeEnd,
14567
14541
  children: Object.entries(pluginItems).map(
14568
- ([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14542
+ ([id, { mobileOnly, render: Render2, label }]) => /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14569
14543
  PluginTab,
14570
14544
  {
14571
14545
  visible: currentPlugin === id,
14572
14546
  mobileOnly,
14573
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Render2, {})
14547
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Render2, {})
14574
14548
  },
14575
14549
  id
14576
14550
  )
14577
14551
  )
14578
14552
  }
14579
14553
  ),
14580
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Canvas, {}),
14581
- !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
14554
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(Canvas, {}),
14555
+ !hasDesktopFieldsPlugin && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
14582
14556
  Sidebar,
14583
14557
  {
14584
14558
  position: "right",
@@ -14586,7 +14560,7 @@ var Layout = ({ children }) => {
14586
14560
  isVisible: rightSideBarVisible,
14587
14561
  onResize: setRightWidth,
14588
14562
  onResizeEnd: handleRightSidebarResizeEnd,
14589
- children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FieldSideBar, {})
14563
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(FieldSideBar, {})
14590
14564
  }
14591
14565
  )
14592
14566
  ]
@@ -14594,17 +14568,17 @@ var Layout = ({ children }) => {
14594
14568
  )
14595
14569
  }
14596
14570
  ) }) }) }),
14597
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { id: "editor-portal-root", className: getClassName44("portal") })
14571
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { id: "editor-portal-root", className: getClassName43("portal") })
14598
14572
  ]
14599
14573
  }
14600
14574
  );
14601
14575
  };
14602
14576
 
14603
14577
  // components/Editor/index.tsx
14604
- var import_jsx_runtime94 = require("react/jsx-runtime");
14578
+ var import_jsx_runtime93 = require("react/jsx-runtime");
14605
14579
  var propsContext = (0, import_react95.createContext)({});
14606
14580
  function PropsProvider(props) {
14607
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(propsContext.Provider, { value: props, children: props.children });
14581
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(propsContext.Provider, { value: props, children: props.children });
14608
14582
  }
14609
14583
  var usePropsContext = () => (0, import_react95.useContext)(propsContext);
14610
14584
  function EditorProvider({ children }) {
@@ -14788,10 +14762,10 @@ function EditorProvider({ children }) {
14788
14762
  resolveAndCommitData();
14789
14763
  }, 0);
14790
14764
  }, []);
14791
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
14765
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(appStoreContext.Provider, { value: appStore, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(UseEditorStoreContext.Provider, { value: uEditorStore, children }) });
14792
14766
  }
14793
14767
  function Editor4(props) {
14794
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Layout, { children: props.children }) })) }));
14768
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(PropsProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(EditorProvider, __spreadProps(__spreadValues({}, props), { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Layout, { children: props.children }) })) }));
14795
14769
  }
14796
14770
  Editor4.Components = Components;
14797
14771
  Editor4.Fields = Fields;
@@ -14873,7 +14847,7 @@ var useApp = () => {
14873
14847
  };
14874
14848
 
14875
14849
  // components/App/AppProvider.tsx
14876
- var import_jsx_runtime95 = require("react/jsx-runtime");
14850
+ var import_jsx_runtime94 = require("react/jsx-runtime");
14877
14851
  var EDITOR_PATH = "/editor";
14878
14852
  var isServer = typeof window === "undefined";
14879
14853
  function AppProvider({
@@ -14894,26 +14868,26 @@ function AppProvider({
14894
14868
  }),
14895
14869
  [config, stablePages, resolvedEditorPath]
14896
14870
  );
14897
- const inner = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(appConfigContext.Provider, { value: ctxValue, children });
14871
+ const inner = /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(appConfigContext.Provider, { value: ctxValue, children });
14898
14872
  if (isServer) {
14899
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_router2.StaticRouter, { location: currentPath != null ? currentPath : "/", children: inner });
14873
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_router2.StaticRouter, { location: currentPath != null ? currentPath : "/", children: inner });
14900
14874
  }
14901
14875
  if (router === "hash") {
14902
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_router2.HashRouter, { children: inner });
14876
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_router2.HashRouter, { children: inner });
14903
14877
  }
14904
14878
  if (router === "memory") {
14905
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_router2.MemoryRouter, { initialEntries: [currentPath != null ? currentPath : "/"], children: inner });
14879
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_router2.MemoryRouter, { initialEntries: [currentPath != null ? currentPath : "/"], children: inner });
14906
14880
  }
14907
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_react_router2.BrowserRouter, { children: inner });
14881
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_react_router2.BrowserRouter, { children: inner });
14908
14882
  }
14909
14883
 
14910
14884
  // components/App/App.tsx
14911
- var import_jsx_runtime96 = require("react/jsx-runtime");
14885
+ var import_jsx_runtime95 = require("react/jsx-runtime");
14912
14886
  var joinEditorPath = (editorPath, route) => {
14913
14887
  if (route === "/") return editorPath;
14914
14888
  return `${editorPath}${route}`;
14915
14889
  };
14916
- var DefaultNotFound = () => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14890
+ var DefaultNotFound = () => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14917
14891
  "div",
14918
14892
  {
14919
14893
  style: {
@@ -14923,20 +14897,20 @@ var DefaultNotFound = () => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14923
14897
  justifyContent: "center",
14924
14898
  alignItems: "center"
14925
14899
  },
14926
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { children: [
14927
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("h1", { children: "404" }),
14928
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("p", { children: "No page matches this route." })
14900
+ children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
14901
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("h1", { children: "404" }),
14902
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { children: "No page matches this route." })
14929
14903
  ] })
14930
14904
  }
14931
14905
  );
14932
- function RenderRoute({
14906
+ function RenderForKey({
14933
14907
  routeKey,
14934
14908
  metadata
14935
14909
  }) {
14936
14910
  const { config, pages } = useApp();
14937
14911
  const data = pages[routeKey];
14938
14912
  if (!data) return null;
14939
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14913
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14940
14914
  Render,
14941
14915
  {
14942
14916
  config,
@@ -14946,91 +14920,118 @@ function RenderRoute({
14946
14920
  routeKey
14947
14921
  );
14948
14922
  }
14949
- function EditorRouteRender({
14923
+ function EditorForKey({
14950
14924
  routeKey,
14951
- layoutProps
14925
+ editorProps,
14926
+ children
14952
14927
  }) {
14953
- const {
14954
- onPublish,
14955
- onChange,
14956
- plugins,
14957
- overrides,
14958
- fieldTransforms,
14959
- metadata,
14960
- iframe,
14961
- viewports,
14962
- permissions
14963
- } = layoutProps;
14964
14928
  const { config, pages, routes, navigate } = useApp();
14965
14929
  const data = pages[routeKey];
14966
14930
  if (!data) return null;
14967
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14931
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14968
14932
  Editor4,
14969
14933
  {
14970
14934
  config,
14971
14935
  data,
14972
- plugins,
14973
- overrides,
14974
- fieldTransforms,
14975
- metadata,
14976
- iframe,
14977
- viewports,
14978
- permissions,
14979
- onChange,
14980
- onPublish,
14936
+ ui: editorProps.ui,
14937
+ plugins: editorProps.plugins,
14938
+ overrides: editorProps.overrides,
14939
+ fieldTransforms: editorProps.fieldTransforms,
14940
+ metadata: editorProps.metadata,
14941
+ iframe: editorProps.iframe,
14942
+ viewports: editorProps.viewports,
14943
+ permissions: editorProps.permissions,
14944
+ onChange: editorProps.onChange,
14945
+ onPublish: editorProps.onPublish,
14946
+ onAction: editorProps.onAction,
14947
+ renderHeader: editorProps.renderHeader,
14948
+ renderHeaderActions: editorProps.renderHeaderActions,
14949
+ title: editorProps.title,
14950
+ dnd: editorProps.dnd,
14951
+ initialHistory: editorProps.initialHistory,
14952
+ height: editorProps.height,
14953
+ fullScreenCanvas: editorProps.fullScreenCanvas,
14954
+ disableZoomControls: editorProps.disableZoomControls,
14955
+ _experimentalVirtualization: editorProps._experimentalVirtualization,
14981
14956
  routes,
14982
14957
  currentRoute: routeKey,
14983
- onRouteChange: (next) => navigate(next)
14958
+ onRouteChange: (next) => navigate(next),
14959
+ children
14984
14960
  },
14985
14961
  routeKey
14986
14962
  );
14987
14963
  }
14988
- function NotFoundRoute({
14989
- renderNotFound
14990
- }) {
14991
- return renderNotFound ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_jsx_runtime96.Fragment, { children: renderNotFound() }) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(DefaultNotFound, {});
14992
- }
14993
- function AppLayout(layoutProps) {
14994
- const { pages, editorPath } = useApp();
14995
- const renderRoutes = Object.keys(pages);
14996
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_react_router3.Routes, { children: [
14997
- renderRoutes.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14964
+ function AppRender({ metadata, renderNotFound }) {
14965
+ const { pages, isEditing } = useApp();
14966
+ if (isEditing) return null;
14967
+ const routeKeys = Object.keys(pages);
14968
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_react_router3.Routes, { children: [
14969
+ routeKeys.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14998
14970
  import_react_router3.Route,
14999
14971
  {
15000
14972
  path: routeKey,
15001
- element: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
15002
- RenderRoute,
14973
+ element: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14974
+ RenderForKey,
15003
14975
  {
15004
14976
  routeKey,
15005
- metadata: layoutProps.metadata
14977
+ metadata
15006
14978
  }
15007
14979
  )
15008
14980
  },
15009
14981
  `render:${routeKey}`
15010
14982
  )),
15011
- editorPath !== null && renderRoutes.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
14983
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
14984
+ import_react_router3.Route,
14985
+ {
14986
+ path: "*",
14987
+ element: renderNotFound ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_jsx_runtime95.Fragment, { children: renderNotFound() }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DefaultNotFound, {})
14988
+ }
14989
+ )
14990
+ ] });
14991
+ }
14992
+ function AppEditor(props) {
14993
+ const _a = props, { children, renderNotFound } = _a, editorProps = __objRest(_a, ["children", "renderNotFound"]);
14994
+ const { pages, isEditing, editorPath } = useApp();
14995
+ if (!isEditing || editorPath === null) return null;
14996
+ const routeKeys = Object.keys(pages);
14997
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_react_router3.Routes, { children: [
14998
+ routeKeys.map((routeKey) => /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
15012
14999
  import_react_router3.Route,
15013
15000
  {
15014
15001
  path: joinEditorPath(editorPath, routeKey),
15015
- element: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
15016
- EditorRouteRender,
15002
+ element: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
15003
+ EditorForKey,
15017
15004
  {
15018
15005
  routeKey,
15019
- layoutProps
15006
+ editorProps,
15007
+ children
15020
15008
  }
15021
15009
  )
15022
15010
  },
15023
15011
  `edit:${routeKey}`
15024
15012
  )),
15025
- /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
15013
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
15026
15014
  import_react_router3.Route,
15027
15015
  {
15028
15016
  path: "*",
15029
- element: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(NotFoundRoute, { renderNotFound: layoutProps.renderNotFound })
15017
+ element: renderNotFound ? /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_jsx_runtime95.Fragment, { children: renderNotFound() }) : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DefaultNotFound, {})
15030
15018
  }
15031
15019
  )
15032
15020
  ] });
15033
15021
  }
15022
+ function DefaultAppLayout(props) {
15023
+ const _a = props, { renderNotFound } = _a, editorProps = __objRest(_a, ["renderNotFound"]);
15024
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_jsx_runtime95.Fragment, { children: [
15025
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
15026
+ AppRender,
15027
+ {
15028
+ metadata: editorProps.metadata,
15029
+ renderNotFound
15030
+ }
15031
+ ),
15032
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(AppEditor, __spreadProps(__spreadValues({}, editorProps), { renderNotFound }))
15033
+ ] });
15034
+ }
15034
15035
  function App(props) {
15035
15036
  const _a = props, {
15036
15037
  config,
@@ -15047,7 +15048,7 @@ function App(props) {
15047
15048
  "router",
15048
15049
  "children"
15049
15050
  ]);
15050
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
15051
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
15051
15052
  AppProvider,
15052
15053
  {
15053
15054
  config,
@@ -15055,10 +15056,12 @@ function App(props) {
15055
15056
  currentPath,
15056
15057
  editorPath,
15057
15058
  router,
15058
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(AppLayout, __spreadValues({}, layoutProps))
15059
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(DefaultAppLayout, __spreadValues({}, layoutProps))
15059
15060
  }
15060
15061
  );
15061
15062
  }
15063
+ App.Render = AppRender;
15064
+ App.Editor = AppEditor;
15062
15065
 
15063
15066
  // components/App/use-route-params.ts
15064
15067
  init_react_import();
@@ -15386,6 +15389,25 @@ function resolveAllData(_0, _1) {
15386
15389
  // bundle/core.ts
15387
15390
  init_walk_tree();
15388
15391
 
15392
+ // plugins/outline/index.tsx
15393
+ init_react_import();
15394
+ init_lucide_react();
15395
+
15396
+ // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/outline/styles.module.css#css-module
15397
+ init_react_import();
15398
+ var styles_module_default36 = { "OutlinePlugin": "_OutlinePlugin_q92j6_1" };
15399
+
15400
+ // plugins/outline/index.tsx
15401
+ init_lib();
15402
+ var import_jsx_runtime96 = require("react/jsx-runtime");
15403
+ var getClassName44 = get_class_name_factory_default("OutlinePlugin", styles_module_default36);
15404
+ var outlinePlugin = () => ({
15405
+ name: "outline",
15406
+ label: "Outline",
15407
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: getClassName44(), children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Outline, {}) }),
15408
+ icon: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Layers, {})
15409
+ });
15410
+
15389
15411
  // plugins/legacy-side-bar/index.tsx
15390
15412
  init_react_import();
15391
15413
  var import_jsx_runtime97 = require("react/jsx-runtime");