@reacteditor/core 0.0.22 → 0.0.24

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.
@@ -510,7 +510,7 @@ type RootDataWithProps<Props extends DefaultComponentProps = DefaultRootFieldPro
510
510
  props: Props;
511
511
  /**
512
512
  * Opt this page's root into the shared root entry in `data.globals` (key
513
- * `__root`). Defaults to `true` when `config.root.global !== false`. Set
513
+ * `root`). Defaults to `true` when `config.root.global !== false`. Set
514
514
  * `false` to make the root page-local while leaving other pages synced.
515
515
  */
516
516
  synced?: boolean;
@@ -510,7 +510,7 @@ type RootDataWithProps<Props extends DefaultComponentProps = DefaultRootFieldPro
510
510
  props: Props;
511
511
  /**
512
512
  * Opt this page's root into the shared root entry in `data.globals` (key
513
- * `__root`). Defaults to `true` when `config.root.global !== false`. Set
513
+ * `root`). Defaults to `true` when `config.root.global !== false`. Set
514
514
  * `false` to make the root page-local while leaving other pages synced.
515
515
  */
516
516
  synced?: boolean;
@@ -113,7 +113,8 @@ var overrideKeys = [
113
113
 
114
114
  // types/Globals.ts
115
115
  init_react_import();
116
- var GLOBAL_ROOT_KEY = "__root";
116
+ var GLOBAL_ROOT_KEY = "root";
117
+ var LEGACY_GLOBAL_ROOT_KEY = "__root";
117
118
 
118
119
  // lib/data/set-deep.ts
119
120
  init_react_import();
@@ -2475,7 +2476,7 @@ import {
2475
2476
 
2476
2477
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
2477
2478
  init_react_import();
2478
- var styles_module_default10 = { "DraggableComponent": "_DraggableComponent_ie0on_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_ie0on_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_ie0on_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_ie0on_36", "DraggableComponent--hover": "_DraggableComponent--hover_ie0on_53", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_ie0on_60", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_ie0on_69", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_ie0on_105", "DraggableComponent-actions": "_DraggableComponent-actions_ie0on_105" };
2479
+ var styles_module_default10 = { "DraggableComponent": "_DraggableComponent_1tskp_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_1tskp_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_1tskp_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1tskp_34", "DraggableComponent--hover": "_DraggableComponent--hover_1tskp_51", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1tskp_58", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_1tskp_66", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1tskp_102", "DraggableComponent-actions": "_DraggableComponent-actions_1tskp_102" };
2479
2480
 
2480
2481
  // components/DraggableComponent/index.tsx
2481
2482
  import { createPortal as createPortal2 } from "react-dom";
@@ -5581,18 +5582,18 @@ function resolveItem(item, globals, config, visitedTypes) {
5581
5582
  return __spreadProps(__spreadValues({}, item), { props: mergedProps });
5582
5583
  }
5583
5584
  function resolveGlobals(data, config) {
5584
- var _a, _b, _c, _d;
5585
+ var _a, _b, _c, _d, _e;
5585
5586
  const globals = data.globals;
5586
5587
  if (!globals || Object.keys(globals).length === 0) return data;
5587
5588
  const visited = /* @__PURE__ */ new Set();
5588
5589
  const content = ((_a = data.content) != null ? _a : []).map(
5589
5590
  (item) => resolveItem(item, globals, config, visited)
5590
5591
  );
5591
- const rootGlobal = globals[GLOBAL_ROOT_KEY];
5592
- const rootSynced = ((_b = data.root) == null ? void 0 : _b.synced) !== false;
5592
+ const rootGlobal = (_b = globals[GLOBAL_ROOT_KEY]) != null ? _b : globals[LEGACY_GLOBAL_ROOT_KEY];
5593
+ const rootSynced = ((_c = data.root) == null ? void 0 : _c.synced) !== false;
5593
5594
  let nextRoot = data.root;
5594
5595
  if (isRootGlobal(config) && rootSynced && rootGlobal) {
5595
- const currentProps = (_d = (_c = data.root) == null ? void 0 : _c.props) != null ? _d : {};
5596
+ const currentProps = (_e = (_d = data.root) == null ? void 0 : _d.props) != null ? _e : {};
5596
5597
  nextRoot = __spreadProps(__spreadValues({}, data.root), {
5597
5598
  props: __spreadValues(__spreadValues(__spreadValues({}, rootGlobal.props), currentProps.children !== void 0 ? { children: currentProps.children } : {}), currentProps.id !== void 0 ? { id: currentProps.id } : {})
5598
5599
  });
@@ -6459,7 +6460,7 @@ var Fields = memo8(FieldsInternal);
6459
6460
 
6460
6461
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
6461
6462
  init_react_import();
6462
- var styles_module_default19 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
6463
+ var styles_module_default19 = { "FieldsPlugin": "_FieldsPlugin_11j3y_1", "FieldsPlugin-header": "_FieldsPlugin-header_11j3y_7" };
6463
6464
 
6464
6465
  // plugins/fields/index.tsx
6465
6466
  import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
@@ -7405,6 +7406,9 @@ var isRootGlobal2 = (config) => {
7405
7406
  function splitGlobals(data, config) {
7406
7407
  var _a, _b, _c, _d;
7407
7408
  const extracted = __spreadValues({}, (_a = data.globals) != null ? _a : {});
7409
+ if (LEGACY_GLOBAL_ROOT_KEY in extracted) {
7410
+ delete extracted[LEGACY_GLOBAL_ROOT_KEY];
7411
+ }
7408
7412
  function visit(node) {
7409
7413
  var _a2, _b2;
7410
7414
  const type = node.type;
@@ -9250,6 +9254,11 @@ import {
9250
9254
  import { jsx as jsx55 } from "react/jsx-runtime";
9251
9255
  var EDITOR_PATH = "/editor";
9252
9256
  var isServer = typeof window === "undefined";
9257
+ var normalizeEditorPath = (path) => {
9258
+ if (!path || path === "/") return EDITOR_PATH;
9259
+ const withLeading = path.startsWith("/") ? path : `/${path}`;
9260
+ return withLeading.length > 1 && withLeading.endsWith("/") ? withLeading.slice(0, -1) : withLeading;
9261
+ };
9253
9262
  var seedGlobalsFromPages = (pages) => {
9254
9263
  const merged = {};
9255
9264
  for (const page of Object.values(pages)) {
@@ -9271,6 +9280,11 @@ function AppProvider({
9271
9280
  currentPath,
9272
9281
  children
9273
9282
  }) {
9283
+ if (!pages || typeof pages !== "object") {
9284
+ throw new Error(
9285
+ "<App> requires a `pages` prop (a map of route \u2192 data). For a single-page setup with no routing, use <Editor> directly instead."
9286
+ );
9287
+ }
9274
9288
  const stablePages = useStableValue(pages);
9275
9289
  const [globals, setGlobals] = useState25(
9276
9290
  () => seedGlobalsFromPages(stablePages)
@@ -9278,7 +9292,7 @@ function AppProvider({
9278
9292
  const updateGlobals = useCallback26((next) => {
9279
9293
  setGlobals(next);
9280
9294
  }, []);
9281
- const resolvedEditorPath = editorPath === null ? null : editorPath || EDITOR_PATH;
9295
+ const resolvedEditorPath = editorPath === null ? null : normalizeEditorPath(editorPath != null ? editorPath : EDITOR_PATH);
9282
9296
  const ctxValue = useMemo26(
9283
9297
  () => ({
9284
9298
  config,
@@ -9611,6 +9625,7 @@ init_react_import();
9611
9625
  export {
9612
9626
  overrideKeys,
9613
9627
  GLOBAL_ROOT_KEY,
9628
+ LEGACY_GLOBAL_ROOT_KEY,
9614
9629
  setDeep,
9615
9630
  Button,
9616
9631
  FieldLabel,
@@ -1,4 +1,4 @@
1
- import { H as History, a as Permissions, b as ComponentData, C as Config, U as UserGenerics, F as Fields, E as EditorAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, e as Overrides, V as Viewports, I as IframeConfig, f as UiState, g as ComponentConfig, A as AppState, M as Metadata, h as FieldTransforms, i as RichtextField } from './actions-D_rLbpVe.js';
1
+ import { H as History, a as Permissions, b as ComponentData, C as Config, U as UserGenerics, F as Fields, E as EditorAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, e as Overrides, V as Viewports, I as IframeConfig, f as UiState, g as ComponentConfig, A as AppState, M as Metadata, h as FieldTransforms, i as RichtextField } from './actions-BxpNoF2q.js';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
@@ -1,4 +1,4 @@
1
- import { H as History, a as Permissions, b as ComponentData, C as Config, U as UserGenerics, F as Fields, E as EditorAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, e as Overrides, V as Viewports, I as IframeConfig, f as UiState, g as ComponentConfig, A as AppState, M as Metadata, h as FieldTransforms, i as RichtextField } from './actions-D_rLbpVe.mjs';
1
+ import { H as History, a as Permissions, b as ComponentData, C as Config, U as UserGenerics, F as Fields, E as EditorAction, R as RootDataWithProps, c as ResolveDataTrigger, d as Plugin, e as Overrides, V as Viewports, I as IframeConfig, f as UiState, g as ComponentConfig, A as AppState, M as Metadata, h as FieldTransforms, i as RichtextField } from './actions-BxpNoF2q.mjs';
2
2
  import { Editor } from '@tiptap/react';
3
3
 
4
4
  type HistorySlice<D = any> = {
package/dist/index.css CHANGED
@@ -743,7 +743,7 @@ textarea._Input-input_zwh6e_27 {
743
743
  opacity: 0 !important;
744
744
  }
745
745
  [data-dnd-placeholder] {
746
- background: var(--editor-color-azure-09) !important;
746
+ background: var(--editor-color-azure-09, #cfdff0) !important;
747
747
  border: none !important;
748
748
  color: #00000000 !important;
749
749
  opacity: 0.3 !important;
@@ -1920,12 +1920,12 @@ textarea._Input-input_zwh6e_27 {
1920
1920
  }
1921
1921
 
1922
1922
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
1923
- ._DraggableComponent_ie0on_1 {
1923
+ ._DraggableComponent_1tskp_1 {
1924
1924
  position: absolute;
1925
1925
  pointer-events: none;
1926
- --overlay-background: color-mix( in srgb, var(--editor-color-azure-05) 14%, transparent );
1926
+ --overlay-background: color-mix( in srgb, var(--editor-color-azure-08) 30%, transparent );
1927
1927
  }
1928
- ._DraggableComponent-overlayWrapper_ie0on_12 {
1928
+ ._DraggableComponent-overlayWrapper_1tskp_12 {
1929
1929
  height: 100%;
1930
1930
  width: 100%;
1931
1931
  top: 0;
@@ -1934,18 +1934,17 @@ textarea._Input-input_zwh6e_27 {
1934
1934
  box-sizing: border-box;
1935
1935
  z-index: 1;
1936
1936
  }
1937
- ._DraggableComponent-overlay_ie0on_12 {
1937
+ ._DraggableComponent-overlay_1tskp_12 {
1938
1938
  cursor: pointer;
1939
1939
  height: 100%;
1940
- outline: 1.5px var(--editor-accent) solid;
1941
- outline-offset: -1.5px;
1940
+ outline: 2px var(--editor-color-azure-09) solid;
1941
+ outline-offset: -2px;
1942
1942
  width: 100%;
1943
- transition: outline-color var(--editor-motion-fast) var(--editor-ease), background-color var(--editor-motion-fast) var(--editor-ease);
1944
1943
  }
1945
- ._DraggableComponent_ie0on_1:focus-visible > ._DraggableComponent-overlayWrapper_ie0on_12 {
1946
- outline: 1px solid var(--editor-accent);
1944
+ ._DraggableComponent_1tskp_1:focus-visible > ._DraggableComponent-overlayWrapper_1tskp_12 {
1945
+ outline: 1px solid var(--editor-color-azure-05);
1947
1946
  }
1948
- ._DraggableComponent-loadingOverlay_ie0on_36 {
1947
+ ._DraggableComponent-loadingOverlay_1tskp_34 {
1949
1948
  background: var(--editor-surface-panel);
1950
1949
  color: var(--editor-text-primary);
1951
1950
  border-radius: var(--editor-radius-md);
@@ -1961,41 +1960,40 @@ textarea._Input-input_zwh6e_27 {
1961
1960
  opacity: 0.85;
1962
1961
  z-index: 1;
1963
1962
  }
1964
- ._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1963
+ ._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1965
1964
  background: var(--overlay-background);
1966
- outline: 1.5px var(--editor-accent) solid;
1965
+ outline: 2px var(--editor-color-azure-09) solid;
1967
1966
  }
1968
- ._DraggableComponent--isSelected_ie0on_60 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1969
- outline-color: var(--editor-accent-strong);
1970
- outline-width: 2px;
1967
+ ._DraggableComponent--isSelected_1tskp_58 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1968
+ outline-color: var(--editor-color-azure-07);
1971
1969
  }
1972
- ._DraggableComponent--isGlobal_ie0on_69 {
1970
+ ._DraggableComponent--isGlobal_1tskp_66 {
1973
1971
  --overlay-background: color-mix( in srgb, var(--editor-color-global) 14%, transparent );
1974
1972
  }
1975
- ._DraggableComponent--isGlobal_ie0on_69 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12,
1976
- ._DraggableComponent--isGlobal_ie0on_69._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1973
+ ._DraggableComponent--isGlobal_1tskp_66 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12,
1974
+ ._DraggableComponent--isGlobal_1tskp_66._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1977
1975
  outline-color: var(--editor-color-global);
1978
1976
  }
1979
- ._DraggableComponent--isGlobal_ie0on_69._DraggableComponent--isSelected_ie0on_60 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1977
+ ._DraggableComponent--isGlobal_1tskp_66._DraggableComponent--isSelected_1tskp_58 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1980
1978
  outline-color: var(--editor-color-global-strong);
1981
1979
  }
1982
- ._DraggableComponent--isGlobal_ie0on_69:focus-visible > ._DraggableComponent-overlayWrapper_ie0on_12 {
1980
+ ._DraggableComponent--isGlobal_1tskp_66:focus-visible > ._DraggableComponent-overlayWrapper_1tskp_12 {
1983
1981
  outline-color: var(--editor-color-global);
1984
1982
  }
1985
- ._DraggableComponent_ie0on_1:has(._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12) > ._DraggableComponent-overlayWrapper_ie0on_12 {
1983
+ ._DraggableComponent_1tskp_1:has(._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12) > ._DraggableComponent-overlayWrapper_1tskp_12 {
1986
1984
  display: none;
1987
1985
  }
1988
- ._DraggableComponent-actionsOverlay_ie0on_105 {
1986
+ ._DraggableComponent-actionsOverlay_1tskp_102 {
1989
1987
  position: sticky;
1990
1988
  opacity: 0;
1991
1989
  pointer-events: none;
1992
1990
  z-index: 2;
1993
1991
  }
1994
- ._DraggableComponent--isSelected_ie0on_60 ._DraggableComponent-actionsOverlay_ie0on_105 {
1992
+ ._DraggableComponent--isSelected_1tskp_58 ._DraggableComponent-actionsOverlay_1tskp_102 {
1995
1993
  opacity: 1;
1996
1994
  pointer-events: auto;
1997
1995
  }
1998
- ._DraggableComponent-actions_ie0on_105 {
1996
+ ._DraggableComponent-actions_1tskp_102 {
1999
1997
  position: absolute;
2000
1998
  width: auto;
2001
1999
  cursor: grab;
@@ -2024,7 +2022,7 @@ textarea._Input-input_zwh6e_27 {
2024
2022
  cursor: pointer;
2025
2023
  }
2026
2024
  [data-dnd-placeholder] {
2027
- background: var(--editor-color-azure-06) !important;
2025
+ background: var(--editor-color-azure-06, #6499cf) !important;
2028
2026
  border: none !important;
2029
2027
  color: #00000000 !important;
2030
2028
  opacity: 0.3 !important;
@@ -2038,9 +2036,15 @@ textarea._Input-input_zwh6e_27 {
2038
2036
  }
2039
2037
  [data-dnd-dragging][data-editor-component] {
2040
2038
  pointer-events: none !important;
2041
- outline: 2px var(--editor-color-azure-09) solid !important;
2039
+ outline: 2px var(--editor-color-azure-09, #cfdff0) solid !important;
2042
2040
  outline-offset: -2px !important;
2043
2041
  }
2042
+ [data-dnd-dragging][data-editor-component] > :first-child {
2043
+ margin-top: 0 !important;
2044
+ }
2045
+ [data-dnd-dragging][data-editor-component] > :last-child {
2046
+ margin-bottom: 0 !important;
2047
+ }
2044
2048
 
2045
2049
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DropZone/styles.module.css/#css-module-data */
2046
2050
  ._DropZone_1h108_1 {
@@ -3144,13 +3148,14 @@ body:has(._DropZone--isAnimating_1h108_70:empty) [data-editor-overlay] {
3144
3148
  }
3145
3149
 
3146
3150
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css/#css-module-data */
3147
- ._FieldsPlugin_262zt_1 {
3148
- background: white;
3151
+ ._FieldsPlugin_11j3y_1 {
3152
+ background: var(--editor-surface-panel);
3149
3153
  height: 100%;
3150
3154
  overflow-y: auto;
3151
3155
  }
3152
- ._FieldsPlugin-header_262zt_7 {
3153
- border-bottom: 1px solid var(--editor-color-grey-09);
3156
+ ._FieldsPlugin-header_11j3y_7 {
3157
+ border-bottom: 1px solid var(--editor-border-subtle);
3158
+ color: var(--editor-text-primary);
3154
3159
  font-weight: 600;
3155
3160
  padding-bottom: 8px;
3156
3161
  padding-left: 16px;
@@ -3158,7 +3163,7 @@ body:has(._DropZone--isAnimating_1h108_70:empty) [data-editor-overlay] {
3158
3163
  padding-top: 8px;
3159
3164
  }
3160
3165
  @media (min-width: 638px) {
3161
- ._FieldsPlugin-header_262zt_7 {
3166
+ ._FieldsPlugin-header_11j3y_7 {
3162
3167
  padding: 16px;
3163
3168
  }
3164
3169
  }
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { D as Data, o as Field, p as FieldProps, C as Config, U as UserGenerics, O as OnAction, f as UiState, q as EditorChromeConfig, d as Plugin, e as Overrides, h as FieldTransforms, M as Metadata, I as IframeConfig, V as Viewports, a as Permissions, E as EditorAction, r as InitialHistory, b as ComponentData, l as DefaultComponentProps, m as DefaultRootFieldProps, c as ResolveDataTrigger, s as ItemSelector, t as PluginInternal } from './actions-D_rLbpVe.mjs';
2
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, k as DefaultComponents, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, a7 as FieldMetadata, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, F as Fields, H as History, ab as ItemWithId, ac as MappedItem, ad as NumberField, ae as ObjectField, af as OverrideKey, ag as RadioField, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as Viewport, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-D_rLbpVe.mjs';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-Dq_FpsiR.mjs';
4
- import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-ByKXq8j5.mjs';
1
+ import { D as Data, o as Field, p as FieldProps, C as Config, U as UserGenerics, O as OnAction, f as UiState, q as EditorChromeConfig, d as Plugin, e as Overrides, h as FieldTransforms, M as Metadata, I as IframeConfig, V as Viewports, a as Permissions, E as EditorAction, r as InitialHistory, b as ComponentData, l as DefaultComponentProps, m as DefaultRootFieldProps, c as ResolveDataTrigger, s as ItemSelector, t as PluginInternal } from './actions-BxpNoF2q.mjs';
2
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, k as DefaultComponents, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, a7 as FieldMetadata, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, F as Fields, H as History, ab as ItemWithId, ac as MappedItem, ad as NumberField, ae as ObjectField, af as OverrideKey, ag as RadioField, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as Viewport, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxpNoF2q.mjs';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-uv_FsXcr.mjs';
4
+ import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-YjPj7lv4.mjs';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as react from 'react';
7
7
  import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
@@ -27,17 +27,25 @@ import '@tiptap/extension-underline';
27
27
  * via `synced: true`; synced instances render from this map (children + id
28
28
  * stay extrinsic).
29
29
  *
30
- * The reserved key `__root` (see {@link GLOBAL_ROOT_KEY}) holds shared props
30
+ * The reserved key `root` (see {@link GLOBAL_ROOT_KEY}) holds shared props
31
31
  * for the page root when `config.root.global !== false` and the page's
32
- * `data.root.synced` is not `false`.
32
+ * `data.root.synced` is not `false`. Matches `data.root` at the top level
33
+ * — same concept, same name.
33
34
  */
34
35
  type GlobalsMap = NonNullable<Data["globals"]>;
35
36
  /**
36
- * Reserved key inside `data.globals` that stores shared root props. Chosen
37
- * with a double underscore so it cannot collide with a user-defined component
38
- * type name.
37
+ * Reserved key inside `data.globals` that stores shared root props. Mirrors
38
+ * the top-level `data.root` field name so the concept is identifiable in
39
+ * both spots. Component types in this codebase are PascalCase by convention,
40
+ * so collision with a lowercase `root` component type is not a real concern.
39
41
  */
40
- declare const GLOBAL_ROOT_KEY: "__root";
42
+ declare const GLOBAL_ROOT_KEY: "root";
43
+ /**
44
+ * Legacy key — `data.globals` rows written by core 0.0.22 used this. The
45
+ * resolver / splitter reads from it as a fallback so stored data keeps
46
+ * resolving until callers re-publish. Safe to remove in a future major.
47
+ */
48
+ declare const LEGACY_GLOBAL_ROOT_KEY: "__root";
41
49
 
42
50
  /**
43
51
  * A route key — the literal string used as a `pages` key in `<App>` and
@@ -597,4 +605,4 @@ declare const outlinePlugin: () => Plugin;
597
605
 
598
606
  declare const legacySideBarPlugin: () => Plugin;
599
607
 
600
- export { Action, ActionBar, App, type AppContextValue, type AppEditorProps, type AppProps, AppProvider, type AppProviderProps, type AppRenderProps, type AppRoute, type AppRouterVariant, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, EditorChromeConfig, type EditorCommands, EditorRoute, Field, FieldLabel, FieldProps, FieldTransforms, GLOBAL_ROOT_KEY, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, Label, Metadata, type MoveDestination, OnAction, OnPublish, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, type RouteKey, Separator, UiState, type UseEditorData, UserGenerics, Viewports, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue };
608
+ export { Action, ActionBar, App, type AppContextValue, type AppEditorProps, type AppProps, AppProvider, type AppProviderProps, type AppRenderProps, type AppRoute, type AppRouterVariant, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, EditorChromeConfig, type EditorCommands, EditorRoute, Field, FieldLabel, FieldProps, FieldTransforms, GLOBAL_ROOT_KEY, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, LEGACY_GLOBAL_ROOT_KEY, Label, Metadata, type MoveDestination, OnAction, OnPublish, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, type RouteKey, Separator, UiState, type UseEditorData, UserGenerics, Viewports, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { D as Data, o as Field, p as FieldProps, C as Config, U as UserGenerics, O as OnAction, f as UiState, q as EditorChromeConfig, d as Plugin, e as Overrides, h as FieldTransforms, M as Metadata, I as IframeConfig, V as Viewports, a as Permissions, E as EditorAction, r as InitialHistory, b as ComponentData, l as DefaultComponentProps, m as DefaultRootFieldProps, c as ResolveDataTrigger, s as ItemSelector, t as PluginInternal } from './actions-D_rLbpVe.js';
2
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, k as DefaultComponents, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, a7 as FieldMetadata, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, F as Fields, H as History, ab as ItemWithId, ac as MappedItem, ad as NumberField, ae as ObjectField, af as OverrideKey, ag as RadioField, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as Viewport, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-D_rLbpVe.js';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-CklAwhBX.js';
4
- import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-jLN0kzKZ.js';
1
+ import { D as Data, o as Field, p as FieldProps, C as Config, U as UserGenerics, O as OnAction, f as UiState, q as EditorChromeConfig, d as Plugin, e as Overrides, h as FieldTransforms, M as Metadata, I as IframeConfig, V as Viewports, a as Permissions, E as EditorAction, r as InitialHistory, b as ComponentData, l as DefaultComponentProps, m as DefaultRootFieldProps, c as ResolveDataTrigger, s as ItemSelector, t as PluginInternal } from './actions-BxpNoF2q.js';
2
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, k as DefaultComponents, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, a7 as FieldMetadata, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, F as Fields, H as History, ab as ItemWithId, ac as MappedItem, ad as NumberField, ae as ObjectField, af as OverrideKey, ag as RadioField, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, aq as Viewport, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxpNoF2q.js';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-BfVJmXEX.js';
4
+ import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-XnBvIAmy.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import * as react from 'react';
7
7
  import react__default, { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
@@ -27,17 +27,25 @@ import '@tiptap/extension-underline';
27
27
  * via `synced: true`; synced instances render from this map (children + id
28
28
  * stay extrinsic).
29
29
  *
30
- * The reserved key `__root` (see {@link GLOBAL_ROOT_KEY}) holds shared props
30
+ * The reserved key `root` (see {@link GLOBAL_ROOT_KEY}) holds shared props
31
31
  * for the page root when `config.root.global !== false` and the page's
32
- * `data.root.synced` is not `false`.
32
+ * `data.root.synced` is not `false`. Matches `data.root` at the top level
33
+ * — same concept, same name.
33
34
  */
34
35
  type GlobalsMap = NonNullable<Data["globals"]>;
35
36
  /**
36
- * Reserved key inside `data.globals` that stores shared root props. Chosen
37
- * with a double underscore so it cannot collide with a user-defined component
38
- * type name.
37
+ * Reserved key inside `data.globals` that stores shared root props. Mirrors
38
+ * the top-level `data.root` field name so the concept is identifiable in
39
+ * both spots. Component types in this codebase are PascalCase by convention,
40
+ * so collision with a lowercase `root` component type is not a real concern.
39
41
  */
40
- declare const GLOBAL_ROOT_KEY: "__root";
42
+ declare const GLOBAL_ROOT_KEY: "root";
43
+ /**
44
+ * Legacy key — `data.globals` rows written by core 0.0.22 used this. The
45
+ * resolver / splitter reads from it as a fallback so stored data keeps
46
+ * resolving until callers re-publish. Safe to remove in a future major.
47
+ */
48
+ declare const LEGACY_GLOBAL_ROOT_KEY: "__root";
41
49
 
42
50
  /**
43
51
  * A route key — the literal string used as a `pages` key in `<App>` and
@@ -597,4 +605,4 @@ declare const outlinePlugin: () => Plugin;
597
605
 
598
606
  declare const legacySideBarPlugin: () => Plugin;
599
607
 
600
- export { Action, ActionBar, App, type AppContextValue, type AppEditorProps, type AppProps, AppProvider, type AppProviderProps, type AppRenderProps, type AppRoute, type AppRouterVariant, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, EditorChromeConfig, type EditorCommands, EditorRoute, Field, FieldLabel, FieldProps, FieldTransforms, GLOBAL_ROOT_KEY, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, Label, Metadata, type MoveDestination, OnAction, OnPublish, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, type RouteKey, Separator, UiState, type UseEditorData, UserGenerics, Viewports, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue };
608
+ export { Action, ActionBar, App, type AppContextValue, type AppEditorProps, type AppProps, AppProvider, type AppProviderProps, type AppRenderProps, type AppRoute, type AppRouterVariant, AutoField, Button, ComponentData, ComponentList, Config, Data, DefaultComponentProps, DefaultRootFieldProps, Drawer, Editor, EditorAction, type EditorApi, EditorChromeConfig, type EditorCommands, EditorRoute, Field, FieldLabel, FieldProps, FieldTransforms, GLOBAL_ROOT_KEY, type GlobalsMap, Group, IconButton, IframeConfig, InitialHistory, type InsertComponentArgs, LEGACY_GLOBAL_ROOT_KEY, Label, Metadata, type MoveDestination, OnAction, OnPublish, Overrides, type PageMetadata, type Parent, Permissions, Plugin, Render, ResolveDataTrigger, RichTextMenu, type Route, type RouteKey, Separator, UiState, type UseEditorData, UserGenerics, Viewports, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue };
package/dist/index.js CHANGED
@@ -5588,6 +5588,7 @@ __export(index_exports, {
5588
5588
  GLOBAL_ROOT_KEY: () => GLOBAL_ROOT_KEY,
5589
5589
  Group: () => Group,
5590
5590
  IconButton: () => IconButton,
5591
+ LEGACY_GLOBAL_ROOT_KEY: () => LEGACY_GLOBAL_ROOT_KEY,
5591
5592
  Label: () => Label,
5592
5593
  Render: () => Render,
5593
5594
  RichTextMenu: () => RichTextMenu,
@@ -5666,7 +5667,8 @@ init_react_import();
5666
5667
 
5667
5668
  // types/Globals.ts
5668
5669
  init_react_import();
5669
- var GLOBAL_ROOT_KEY = "__root";
5670
+ var GLOBAL_ROOT_KEY = "root";
5671
+ var LEGACY_GLOBAL_ROOT_KEY = "__root";
5670
5672
 
5671
5673
  // types/Props.tsx
5672
5674
  init_react_import();
@@ -8337,7 +8339,7 @@ var import_react53 = require("react");
8337
8339
 
8338
8340
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
8339
8341
  init_react_import();
8340
- var styles_module_default19 = { "DraggableComponent": "_DraggableComponent_ie0on_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_ie0on_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_ie0on_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_ie0on_36", "DraggableComponent--hover": "_DraggableComponent--hover_ie0on_53", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_ie0on_60", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_ie0on_69", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_ie0on_105", "DraggableComponent-actions": "_DraggableComponent-actions_ie0on_105" };
8342
+ var styles_module_default19 = { "DraggableComponent": "_DraggableComponent_1tskp_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_1tskp_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_1tskp_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1tskp_34", "DraggableComponent--hover": "_DraggableComponent--hover_1tskp_51", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1tskp_58", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_1tskp_66", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1tskp_102", "DraggableComponent-actions": "_DraggableComponent-actions_1tskp_102" };
8341
8343
 
8342
8344
  // components/DraggableComponent/index.tsx
8343
8345
  init_get_class_name_factory();
@@ -9568,18 +9570,18 @@ function resolveItem(item, globals, config, visitedTypes) {
9568
9570
  return __spreadProps(__spreadValues({}, item), { props: mergedProps });
9569
9571
  }
9570
9572
  function resolveGlobals(data, config) {
9571
- var _a, _b, _c, _d;
9573
+ var _a, _b, _c, _d, _e;
9572
9574
  const globals = data.globals;
9573
9575
  if (!globals || Object.keys(globals).length === 0) return data;
9574
9576
  const visited = /* @__PURE__ */ new Set();
9575
9577
  const content = ((_a = data.content) != null ? _a : []).map(
9576
9578
  (item) => resolveItem(item, globals, config, visited)
9577
9579
  );
9578
- const rootGlobal = globals[GLOBAL_ROOT_KEY];
9579
- const rootSynced = ((_b = data.root) == null ? void 0 : _b.synced) !== false;
9580
+ const rootGlobal = (_b = globals[GLOBAL_ROOT_KEY]) != null ? _b : globals[LEGACY_GLOBAL_ROOT_KEY];
9581
+ const rootSynced = ((_c = data.root) == null ? void 0 : _c.synced) !== false;
9580
9582
  let nextRoot = data.root;
9581
9583
  if (isRootGlobal(config) && rootSynced && rootGlobal) {
9582
- const currentProps = (_d = (_c = data.root) == null ? void 0 : _c.props) != null ? _d : {};
9584
+ const currentProps = (_e = (_d = data.root) == null ? void 0 : _d.props) != null ? _e : {};
9583
9585
  nextRoot = __spreadProps(__spreadValues({}, data.root), {
9584
9586
  props: __spreadValues(__spreadValues(__spreadValues({}, rootGlobal.props), currentProps.children !== void 0 ? { children: currentProps.children } : {}), currentProps.id !== void 0 ? { id: currentProps.id } : {})
9585
9587
  });
@@ -13102,6 +13104,9 @@ var isRootGlobal2 = (config) => {
13102
13104
  function splitGlobals(data, config) {
13103
13105
  var _a, _b, _c, _d;
13104
13106
  const extracted = __spreadValues({}, (_a = data.globals) != null ? _a : {});
13107
+ if (LEGACY_GLOBAL_ROOT_KEY in extracted) {
13108
+ delete extracted[LEGACY_GLOBAL_ROOT_KEY];
13109
+ }
13105
13110
  function visit(node) {
13106
13111
  var _a2, _b2;
13107
13112
  const type = node.type;
@@ -14313,7 +14318,7 @@ init_store();
14313
14318
 
14314
14319
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
14315
14320
  init_react_import();
14316
- var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
14321
+ var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_11j3y_1", "FieldsPlugin-header": "_FieldsPlugin-header_11j3y_7" };
14317
14322
 
14318
14323
  // plugins/fields/index.tsx
14319
14324
  init_lib();
@@ -15103,6 +15108,11 @@ var useApp = () => {
15103
15108
  var import_jsx_runtime93 = require("react/jsx-runtime");
15104
15109
  var EDITOR_PATH = "/editor";
15105
15110
  var isServer = typeof window === "undefined";
15111
+ var normalizeEditorPath = (path) => {
15112
+ if (!path || path === "/") return EDITOR_PATH;
15113
+ const withLeading = path.startsWith("/") ? path : `/${path}`;
15114
+ return withLeading.length > 1 && withLeading.endsWith("/") ? withLeading.slice(0, -1) : withLeading;
15115
+ };
15106
15116
  var seedGlobalsFromPages = (pages) => {
15107
15117
  const merged = {};
15108
15118
  for (const page of Object.values(pages)) {
@@ -15124,6 +15134,11 @@ function AppProvider({
15124
15134
  currentPath,
15125
15135
  children
15126
15136
  }) {
15137
+ if (!pages || typeof pages !== "object") {
15138
+ throw new Error(
15139
+ "<App> requires a `pages` prop (a map of route \u2192 data). For a single-page setup with no routing, use <Editor> directly instead."
15140
+ );
15141
+ }
15127
15142
  const stablePages = useStableValue(pages);
15128
15143
  const [globals, setGlobals] = (0, import_react98.useState)(
15129
15144
  () => seedGlobalsFromPages(stablePages)
@@ -15131,7 +15146,7 @@ function AppProvider({
15131
15146
  const updateGlobals = (0, import_react98.useCallback)((next) => {
15132
15147
  setGlobals(next);
15133
15148
  }, []);
15134
- const resolvedEditorPath = editorPath === null ? null : editorPath || EDITOR_PATH;
15149
+ const resolvedEditorPath = editorPath === null ? null : normalizeEditorPath(editorPath != null ? editorPath : EDITOR_PATH);
15135
15150
  const ctxValue = (0, import_react98.useMemo)(
15136
15151
  () => ({
15137
15152
  config,
@@ -15730,6 +15745,7 @@ var legacySideBarPlugin = () => ({
15730
15745
  GLOBAL_ROOT_KEY,
15731
15746
  Group,
15732
15747
  IconButton,
15748
+ LEGACY_GLOBAL_ROOT_KEY,
15733
15749
  Label,
15734
15750
  Render,
15735
15751
  RichTextMenu,
package/dist/index.mjs CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  Editor,
9
9
  FieldLabel,
10
10
  GLOBAL_ROOT_KEY,
11
+ LEGACY_GLOBAL_ROOT_KEY,
11
12
  Render,
12
13
  appConfigContext,
13
14
  blocksPlugin,
@@ -26,7 +27,7 @@ import {
26
27
  usePropsContext,
27
28
  useRouteParams,
28
29
  useStableValue
29
- } from "./chunk-UOKINS3M.mjs";
30
+ } from "./chunk-KX5236PM.mjs";
30
31
  import "./chunk-UEPLVAME.mjs";
31
32
  import {
32
33
  Action,
@@ -75,6 +76,7 @@ export {
75
76
  GLOBAL_ROOT_KEY,
76
77
  Group,
77
78
  IconButton,
79
+ LEGACY_GLOBAL_ROOT_KEY,
78
80
  Label,
79
81
  Render,
80
82
  RichTextMenu,
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-D_rLbpVe.mjs';
3
- import { A as AppStore } from './index-ByKXq8j5.mjs';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxpNoF2q.mjs';
3
+ import { A as AppStore } from './index-YjPj7lv4.mjs';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
- import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-D_rLbpVe.js';
3
- import { A as AppStore } from './index-jLN0kzKZ.js';
2
+ import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxpNoF2q.js';
3
+ import { A as AppStore } from './index-XnBvIAmy.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -741,7 +741,7 @@ textarea._Input-input_zwh6e_27 {
741
741
  opacity: 0 !important;
742
742
  }
743
743
  [data-dnd-placeholder] {
744
- background: var(--editor-color-azure-09) !important;
744
+ background: var(--editor-color-azure-09, #cfdff0) !important;
745
745
  border: none !important;
746
746
  color: #00000000 !important;
747
747
  opacity: 0.3 !important;
@@ -1918,12 +1918,12 @@ textarea._Input-input_zwh6e_27 {
1918
1918
  }
1919
1919
 
1920
1920
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css/#css-module-data */
1921
- ._DraggableComponent_ie0on_1 {
1921
+ ._DraggableComponent_1tskp_1 {
1922
1922
  position: absolute;
1923
1923
  pointer-events: none;
1924
- --overlay-background: color-mix( in srgb, var(--editor-color-azure-05) 14%, transparent );
1924
+ --overlay-background: color-mix( in srgb, var(--editor-color-azure-08) 30%, transparent );
1925
1925
  }
1926
- ._DraggableComponent-overlayWrapper_ie0on_12 {
1926
+ ._DraggableComponent-overlayWrapper_1tskp_12 {
1927
1927
  height: 100%;
1928
1928
  width: 100%;
1929
1929
  top: 0;
@@ -1932,18 +1932,17 @@ textarea._Input-input_zwh6e_27 {
1932
1932
  box-sizing: border-box;
1933
1933
  z-index: 1;
1934
1934
  }
1935
- ._DraggableComponent-overlay_ie0on_12 {
1935
+ ._DraggableComponent-overlay_1tskp_12 {
1936
1936
  cursor: pointer;
1937
1937
  height: 100%;
1938
- outline: 1.5px var(--editor-accent) solid;
1939
- outline-offset: -1.5px;
1938
+ outline: 2px var(--editor-color-azure-09) solid;
1939
+ outline-offset: -2px;
1940
1940
  width: 100%;
1941
- transition: outline-color var(--editor-motion-fast) var(--editor-ease), background-color var(--editor-motion-fast) var(--editor-ease);
1942
1941
  }
1943
- ._DraggableComponent_ie0on_1:focus-visible > ._DraggableComponent-overlayWrapper_ie0on_12 {
1944
- outline: 1px solid var(--editor-accent);
1942
+ ._DraggableComponent_1tskp_1:focus-visible > ._DraggableComponent-overlayWrapper_1tskp_12 {
1943
+ outline: 1px solid var(--editor-color-azure-05);
1945
1944
  }
1946
- ._DraggableComponent-loadingOverlay_ie0on_36 {
1945
+ ._DraggableComponent-loadingOverlay_1tskp_34 {
1947
1946
  background: var(--editor-surface-panel);
1948
1947
  color: var(--editor-text-primary);
1949
1948
  border-radius: var(--editor-radius-md);
@@ -1959,41 +1958,40 @@ textarea._Input-input_zwh6e_27 {
1959
1958
  opacity: 0.85;
1960
1959
  z-index: 1;
1961
1960
  }
1962
- ._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1961
+ ._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1963
1962
  background: var(--overlay-background);
1964
- outline: 1.5px var(--editor-accent) solid;
1963
+ outline: 2px var(--editor-color-azure-09) solid;
1965
1964
  }
1966
- ._DraggableComponent--isSelected_ie0on_60 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1967
- outline-color: var(--editor-accent-strong);
1968
- outline-width: 2px;
1965
+ ._DraggableComponent--isSelected_1tskp_58 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1966
+ outline-color: var(--editor-color-azure-07);
1969
1967
  }
1970
- ._DraggableComponent--isGlobal_ie0on_69 {
1968
+ ._DraggableComponent--isGlobal_1tskp_66 {
1971
1969
  --overlay-background: color-mix( in srgb, var(--editor-color-global) 14%, transparent );
1972
1970
  }
1973
- ._DraggableComponent--isGlobal_ie0on_69 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12,
1974
- ._DraggableComponent--isGlobal_ie0on_69._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1971
+ ._DraggableComponent--isGlobal_1tskp_66 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12,
1972
+ ._DraggableComponent--isGlobal_1tskp_66._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1975
1973
  outline-color: var(--editor-color-global);
1976
1974
  }
1977
- ._DraggableComponent--isGlobal_ie0on_69._DraggableComponent--isSelected_ie0on_60 > ._DraggableComponent-overlayWrapper_ie0on_12 > ._DraggableComponent-overlay_ie0on_12 {
1975
+ ._DraggableComponent--isGlobal_1tskp_66._DraggableComponent--isSelected_1tskp_58 > ._DraggableComponent-overlayWrapper_1tskp_12 > ._DraggableComponent-overlay_1tskp_12 {
1978
1976
  outline-color: var(--editor-color-global-strong);
1979
1977
  }
1980
- ._DraggableComponent--isGlobal_ie0on_69:focus-visible > ._DraggableComponent-overlayWrapper_ie0on_12 {
1978
+ ._DraggableComponent--isGlobal_1tskp_66:focus-visible > ._DraggableComponent-overlayWrapper_1tskp_12 {
1981
1979
  outline-color: var(--editor-color-global);
1982
1980
  }
1983
- ._DraggableComponent_ie0on_1:has(._DraggableComponent--hover_ie0on_53 > ._DraggableComponent-overlayWrapper_ie0on_12) > ._DraggableComponent-overlayWrapper_ie0on_12 {
1981
+ ._DraggableComponent_1tskp_1:has(._DraggableComponent--hover_1tskp_51 > ._DraggableComponent-overlayWrapper_1tskp_12) > ._DraggableComponent-overlayWrapper_1tskp_12 {
1984
1982
  display: none;
1985
1983
  }
1986
- ._DraggableComponent-actionsOverlay_ie0on_105 {
1984
+ ._DraggableComponent-actionsOverlay_1tskp_102 {
1987
1985
  position: sticky;
1988
1986
  opacity: 0;
1989
1987
  pointer-events: none;
1990
1988
  z-index: 2;
1991
1989
  }
1992
- ._DraggableComponent--isSelected_ie0on_60 ._DraggableComponent-actionsOverlay_ie0on_105 {
1990
+ ._DraggableComponent--isSelected_1tskp_58 ._DraggableComponent-actionsOverlay_1tskp_102 {
1993
1991
  opacity: 1;
1994
1992
  pointer-events: auto;
1995
1993
  }
1996
- ._DraggableComponent-actions_ie0on_105 {
1994
+ ._DraggableComponent-actions_1tskp_102 {
1997
1995
  position: absolute;
1998
1996
  width: auto;
1999
1997
  cursor: grab;
@@ -2022,7 +2020,7 @@ textarea._Input-input_zwh6e_27 {
2022
2020
  cursor: pointer;
2023
2021
  }
2024
2022
  [data-dnd-placeholder] {
2025
- background: var(--editor-color-azure-06) !important;
2023
+ background: var(--editor-color-azure-06, #6499cf) !important;
2026
2024
  border: none !important;
2027
2025
  color: #00000000 !important;
2028
2026
  opacity: 0.3 !important;
@@ -2036,9 +2034,15 @@ textarea._Input-input_zwh6e_27 {
2036
2034
  }
2037
2035
  [data-dnd-dragging][data-editor-component] {
2038
2036
  pointer-events: none !important;
2039
- outline: 2px var(--editor-color-azure-09) solid !important;
2037
+ outline: 2px var(--editor-color-azure-09, #cfdff0) solid !important;
2040
2038
  outline-offset: -2px !important;
2041
2039
  }
2040
+ [data-dnd-dragging][data-editor-component] > :first-child {
2041
+ margin-top: 0 !important;
2042
+ }
2043
+ [data-dnd-dragging][data-editor-component] > :last-child {
2044
+ margin-bottom: 0 !important;
2045
+ }
2042
2046
 
2043
2047
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DropZone/styles.module.css/#css-module-data */
2044
2048
  ._DropZone_1h108_1 {
@@ -3142,13 +3146,14 @@ body:has(._DropZone--isAnimating_1h108_70:empty) [data-editor-overlay] {
3142
3146
  }
3143
3147
 
3144
3148
  /* css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css/#css-module-data */
3145
- ._FieldsPlugin_262zt_1 {
3146
- background: white;
3149
+ ._FieldsPlugin_11j3y_1 {
3150
+ background: var(--editor-surface-panel);
3147
3151
  height: 100%;
3148
3152
  overflow-y: auto;
3149
3153
  }
3150
- ._FieldsPlugin-header_262zt_7 {
3151
- border-bottom: 1px solid var(--editor-color-grey-09);
3154
+ ._FieldsPlugin-header_11j3y_7 {
3155
+ border-bottom: 1px solid var(--editor-border-subtle);
3156
+ color: var(--editor-text-primary);
3152
3157
  font-weight: 600;
3153
3158
  padding-bottom: 8px;
3154
3159
  padding-left: 16px;
@@ -3156,7 +3161,7 @@ body:has(._DropZone--isAnimating_1h108_70:empty) [data-editor-overlay] {
3156
3161
  padding-top: 8px;
3157
3162
  }
3158
3163
  @media (min-width: 638px) {
3159
- ._FieldsPlugin-header_262zt_7 {
3164
+ ._FieldsPlugin-header_11j3y_7 {
3160
3165
  padding: 16px;
3161
3166
  }
3162
3167
  }
@@ -1,7 +1,7 @@
1
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-D_rLbpVe.mjs';
2
- export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GLOBAL_ROOT_KEY, GlobalsMap, Group, IconButton, InsertComponentArgs, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.mjs';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-Dq_FpsiR.mjs';
4
- export { E as EditorRoute, O as OnPublish } from './index-ByKXq8j5.mjs';
1
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxpNoF2q.mjs';
2
+ export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GLOBAL_ROOT_KEY, GlobalsMap, Group, IconButton, InsertComponentArgs, LEGACY_GLOBAL_ROOT_KEY, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.mjs';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-uv_FsXcr.mjs';
4
+ export { E as EditorRoute, O as OnPublish } from './index-YjPj7lv4.mjs';
5
5
  import 'react';
6
6
  import '@tiptap/react';
7
7
  import '@tiptap/extension-blockquote';
@@ -1,7 +1,7 @@
1
- export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-D_rLbpVe.js';
2
- export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GLOBAL_ROOT_KEY, GlobalsMap, Group, IconButton, InsertComponentArgs, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.js';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-CklAwhBX.js';
4
- export { E as EditorRoute, O as OnPublish } from './index-jLN0kzKZ.js';
1
+ export { u as Adaptor, A as AppState, v as ArrayField, w as ArrayState, x as AsFieldProps, B as BaseData, y as BaseField, z as CacheOpts, G as ColorField, g as ComponentConfig, J as ComponentConfigExtensions, K as ComponentConfigParams, b as ComponentData, L as ComponentDataMap, N as ComponentDataOptionalId, Q as ComponentMetadata, C as Config, S as ConfigParams, j as Content, T as CustomField, X as CustomFieldRender, D as Data, l as DefaultComponentProps, k as DefaultComponents, m as DefaultRootFieldProps, Y as DefaultRootProps, Z as DefaultRootRenderProps, _ as Direction, $ as DragAxis, E as EditorAction, q as EditorChromeConfig, a0 as EditorComponent, a1 as EditorContext, a2 as EditorMetadata, a3 as ExternalField, a4 as ExternalFieldWithAdaptor, a5 as ExtractConfigParams, a6 as ExtractField, o as Field, a7 as FieldMetadata, p as FieldProps, a8 as FieldRenderFunctions, a9 as FieldTransformFn, aa as FieldTransformFnParams, h as FieldTransforms, F as Fields, H as History, I as IframeConfig, r as InitialHistory, ab as ItemWithId, ac as MappedItem, M as Metadata, ad as NumberField, ae as ObjectField, O as OnAction, af as OverrideKey, e as Overrides, a as Permissions, d as Plugin, ag as RadioField, c as ResolveDataTrigger, ah as RichText, i as RichtextField, ai as RootConfig, n as RootData, R as RootDataWithProps, aj as RootDataWithoutProps, ak as SelectField, al as Slot, am as SlotComponent, an as SlotField, ao as TextField, ap as TextareaField, f as UiState, U as UserGenerics, aq as Viewport, V as Viewports, ar as WithChildren, as as WithEditorProps, W as WithId, at as WithSlotProps, au as overrideKeys } from './actions-BxpNoF2q.js';
2
+ export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, GLOBAL_ROOT_KEY, GlobalsMap, Group, IconButton, InsertComponentArgs, LEGACY_GLOBAL_ROOT_KEY, Label, MoveDestination, PageMetadata, Parent, Render, RichTextMenu, Route, RouteKey, Separator, UseEditorData, appConfigContext, blocksPlugin, createUseEditor, fieldsPlugin, legacySideBarPlugin, outlinePlugin, pageMetadata, registerOverlayPortal, renderContext, setDeep, useApp, useEditor, useGetEditor, usePropsContext, useRouteParams, useStableValue } from './index.js';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-BfVJmXEX.js';
4
+ export { E as EditorRoute, O as OnPublish } from './index-XnBvIAmy.js';
5
5
  import 'react';
6
6
  import '@tiptap/react';
7
7
  import '@tiptap/extension-blockquote';
@@ -5588,6 +5588,7 @@ __export(no_external_exports, {
5588
5588
  GLOBAL_ROOT_KEY: () => GLOBAL_ROOT_KEY,
5589
5589
  Group: () => Group,
5590
5590
  IconButton: () => IconButton,
5591
+ LEGACY_GLOBAL_ROOT_KEY: () => LEGACY_GLOBAL_ROOT_KEY,
5591
5592
  Label: () => Label,
5592
5593
  Render: () => Render,
5593
5594
  RichTextMenu: () => RichTextMenu,
@@ -5666,7 +5667,8 @@ init_react_import();
5666
5667
 
5667
5668
  // types/Globals.ts
5668
5669
  init_react_import();
5669
- var GLOBAL_ROOT_KEY = "__root";
5670
+ var GLOBAL_ROOT_KEY = "root";
5671
+ var LEGACY_GLOBAL_ROOT_KEY = "__root";
5670
5672
 
5671
5673
  // types/Props.tsx
5672
5674
  init_react_import();
@@ -8337,7 +8339,7 @@ var import_react53 = require("react");
8337
8339
 
8338
8340
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/components/DraggableComponent/styles.module.css#css-module
8339
8341
  init_react_import();
8340
- var styles_module_default19 = { "DraggableComponent": "_DraggableComponent_ie0on_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_ie0on_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_ie0on_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_ie0on_36", "DraggableComponent--hover": "_DraggableComponent--hover_ie0on_53", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_ie0on_60", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_ie0on_69", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_ie0on_105", "DraggableComponent-actions": "_DraggableComponent-actions_ie0on_105" };
8342
+ var styles_module_default19 = { "DraggableComponent": "_DraggableComponent_1tskp_1", "DraggableComponent-overlayWrapper": "_DraggableComponent-overlayWrapper_1tskp_12", "DraggableComponent-overlay": "_DraggableComponent-overlay_1tskp_12", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1tskp_34", "DraggableComponent--hover": "_DraggableComponent--hover_1tskp_51", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1tskp_58", "DraggableComponent--isGlobal": "_DraggableComponent--isGlobal_1tskp_66", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1tskp_102", "DraggableComponent-actions": "_DraggableComponent-actions_1tskp_102" };
8341
8343
 
8342
8344
  // components/DraggableComponent/index.tsx
8343
8345
  init_get_class_name_factory();
@@ -9568,18 +9570,18 @@ function resolveItem(item, globals, config, visitedTypes) {
9568
9570
  return __spreadProps(__spreadValues({}, item), { props: mergedProps });
9569
9571
  }
9570
9572
  function resolveGlobals(data, config) {
9571
- var _a, _b, _c, _d;
9573
+ var _a, _b, _c, _d, _e;
9572
9574
  const globals = data.globals;
9573
9575
  if (!globals || Object.keys(globals).length === 0) return data;
9574
9576
  const visited = /* @__PURE__ */ new Set();
9575
9577
  const content = ((_a = data.content) != null ? _a : []).map(
9576
9578
  (item) => resolveItem(item, globals, config, visited)
9577
9579
  );
9578
- const rootGlobal = globals[GLOBAL_ROOT_KEY];
9579
- const rootSynced = ((_b = data.root) == null ? void 0 : _b.synced) !== false;
9580
+ const rootGlobal = (_b = globals[GLOBAL_ROOT_KEY]) != null ? _b : globals[LEGACY_GLOBAL_ROOT_KEY];
9581
+ const rootSynced = ((_c = data.root) == null ? void 0 : _c.synced) !== false;
9580
9582
  let nextRoot = data.root;
9581
9583
  if (isRootGlobal(config) && rootSynced && rootGlobal) {
9582
- const currentProps = (_d = (_c = data.root) == null ? void 0 : _c.props) != null ? _d : {};
9584
+ const currentProps = (_e = (_d = data.root) == null ? void 0 : _d.props) != null ? _e : {};
9583
9585
  nextRoot = __spreadProps(__spreadValues({}, data.root), {
9584
9586
  props: __spreadValues(__spreadValues(__spreadValues({}, rootGlobal.props), currentProps.children !== void 0 ? { children: currentProps.children } : {}), currentProps.id !== void 0 ? { id: currentProps.id } : {})
9585
9587
  });
@@ -13102,6 +13104,9 @@ var isRootGlobal2 = (config) => {
13102
13104
  function splitGlobals(data, config) {
13103
13105
  var _a, _b, _c, _d;
13104
13106
  const extracted = __spreadValues({}, (_a = data.globals) != null ? _a : {});
13107
+ if (LEGACY_GLOBAL_ROOT_KEY in extracted) {
13108
+ delete extracted[LEGACY_GLOBAL_ROOT_KEY];
13109
+ }
13105
13110
  function visit(node) {
13106
13111
  var _a2, _b2;
13107
13112
  const type = node.type;
@@ -14313,7 +14318,7 @@ init_store();
14313
14318
 
14314
14319
  // css-module:/Users/rami/Documents/apps/react-editor/packages/core/plugins/fields/styles.module.css#css-module
14315
14320
  init_react_import();
14316
- var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_262zt_1", "FieldsPlugin-header": "_FieldsPlugin-header_262zt_7" };
14321
+ var styles_module_default34 = { "FieldsPlugin": "_FieldsPlugin_11j3y_1", "FieldsPlugin-header": "_FieldsPlugin-header_11j3y_7" };
14317
14322
 
14318
14323
  // plugins/fields/index.tsx
14319
14324
  init_lib();
@@ -15103,6 +15108,11 @@ var useApp = () => {
15103
15108
  var import_jsx_runtime93 = require("react/jsx-runtime");
15104
15109
  var EDITOR_PATH = "/editor";
15105
15110
  var isServer = typeof window === "undefined";
15111
+ var normalizeEditorPath = (path) => {
15112
+ if (!path || path === "/") return EDITOR_PATH;
15113
+ const withLeading = path.startsWith("/") ? path : `/${path}`;
15114
+ return withLeading.length > 1 && withLeading.endsWith("/") ? withLeading.slice(0, -1) : withLeading;
15115
+ };
15106
15116
  var seedGlobalsFromPages = (pages) => {
15107
15117
  const merged = {};
15108
15118
  for (const page of Object.values(pages)) {
@@ -15124,6 +15134,11 @@ function AppProvider({
15124
15134
  currentPath,
15125
15135
  children
15126
15136
  }) {
15137
+ if (!pages || typeof pages !== "object") {
15138
+ throw new Error(
15139
+ "<App> requires a `pages` prop (a map of route \u2192 data). For a single-page setup with no routing, use <Editor> directly instead."
15140
+ );
15141
+ }
15127
15142
  const stablePages = useStableValue(pages);
15128
15143
  const [globals, setGlobals] = (0, import_react98.useState)(
15129
15144
  () => seedGlobalsFromPages(stablePages)
@@ -15131,7 +15146,7 @@ function AppProvider({
15131
15146
  const updateGlobals = (0, import_react98.useCallback)((next) => {
15132
15147
  setGlobals(next);
15133
15148
  }, []);
15134
- const resolvedEditorPath = editorPath === null ? null : editorPath || EDITOR_PATH;
15149
+ const resolvedEditorPath = editorPath === null ? null : normalizeEditorPath(editorPath != null ? editorPath : EDITOR_PATH);
15135
15150
  const ctxValue = (0, import_react98.useMemo)(
15136
15151
  () => ({
15137
15152
  config,
@@ -15730,6 +15745,7 @@ var legacySideBarPlugin = () => ({
15730
15745
  GLOBAL_ROOT_KEY,
15731
15746
  Group,
15732
15747
  IconButton,
15748
+ LEGACY_GLOBAL_ROOT_KEY,
15733
15749
  Label,
15734
15750
  Render,
15735
15751
  RichTextMenu,
@@ -8,6 +8,7 @@ import {
8
8
  Editor,
9
9
  FieldLabel,
10
10
  GLOBAL_ROOT_KEY,
11
+ LEGACY_GLOBAL_ROOT_KEY,
11
12
  Render,
12
13
  appConfigContext,
13
14
  blocksPlugin,
@@ -26,7 +27,7 @@ import {
26
27
  usePropsContext,
27
28
  useRouteParams,
28
29
  useStableValue
29
- } from "./chunk-UOKINS3M.mjs";
30
+ } from "./chunk-KX5236PM.mjs";
30
31
  import "./chunk-UEPLVAME.mjs";
31
32
  import {
32
33
  Action,
@@ -75,6 +76,7 @@ export {
75
76
  GLOBAL_ROOT_KEY,
76
77
  Group,
77
78
  IconButton,
79
+ LEGACY_GLOBAL_ROOT_KEY,
78
80
  Label,
79
81
  Render,
80
82
  RichTextMenu,
package/dist/rsc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './actions-D_rLbpVe.mjs';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-Dq_FpsiR.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-BxpNoF2q.mjs';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-uv_FsXcr.mjs';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
package/dist/rsc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { C as Config, U as UserGenerics, M as Metadata } from './actions-D_rLbpVe.js';
3
- export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-CklAwhBX.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-BxpNoF2q.js';
3
+ export { G as GetRoutePropsOptions, g as getRouteProps, m as migrate, r as resolveAllData, a as resolveRouteFromString, t as transformProps, w as walkTree } from './walk-tree-BfVJmXEX.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, j as Content, b as ComponentData, k as DefaultComponents, l as DefaultComponentProps, m as DefaultRootFieldProps, M as Metadata, n as RootData } from './actions-D_rLbpVe.js';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, j as Content, b as ComponentData, k as DefaultComponents, l as DefaultComponentProps, m as DefaultRootFieldProps, M as Metadata, n as RootData } from './actions-BxpNoF2q.js';
2
2
 
3
3
  type GetRoutePropsOptions = {
4
4
  /** Defaults to "/editor". Pass null to skip editor-prefix handling. */
@@ -1,4 +1,4 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, j as Content, b as ComponentData, k as DefaultComponents, l as DefaultComponentProps, m as DefaultRootFieldProps, M as Metadata, n as RootData } from './actions-D_rLbpVe.mjs';
1
+ import { C as Config, D as Data, W as WithId, U as UserGenerics, j as Content, b as ComponentData, k as DefaultComponents, l as DefaultComponentProps, m as DefaultRootFieldProps, M as Metadata, n as RootData } from './actions-BxpNoF2q.mjs';
2
2
 
3
3
  type GetRoutePropsOptions = {
4
4
  /** Defaults to "/editor". Pass null to skip editor-prefix handling. */
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@reacteditor/core",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Frontend AI, Inc.",
6
6
  "repository": "reacteditor/editor",
7
7
  "bugs": "https://github.com/reacteditor/editor/issues",
8
8
  "homepage": "https://reacteditor.dev",
9
9
  "keywords": [
10
+ "ai",
10
11
  "editor",
11
12
  "visual",
12
- "editor",
13
13
  "react",
14
14
  "drag and drop",
15
15
  "dnd",
@@ -93,7 +93,6 @@
93
93
  "@types/object-hash": "^3.0.6",
94
94
  "@types/react": "^19.2.7",
95
95
  "@types/react-dom": "^19.2.3",
96
- "@types/uuid": "^10.0.0",
97
96
  "css-box-model": "^1.2.1",
98
97
  "eslint": "^7.32.0",
99
98
  "eslint-config-custom": "*",
@@ -146,8 +145,8 @@
146
145
  "object-hash": "^3.0.0",
147
146
  "react-hotkeys-hook": "^4.6.1",
148
147
  "use-debounce": "^9.0.4",
149
- "uuid": "^9.0.1",
150
- "zustand": "^5.0.3"
148
+ "uuid": "^11.1.1",
149
+ "zustand": "^5.0.13"
151
150
  },
152
151
  "peerDependencies": {
153
152
  "react": "^18.0.0 || ^19.0.0",