@reacteditor/core 0.0.18 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ React Editor is [licensed under MIT](https://github.com/reacteditor/editor?tab=M
11
11
  Install the package:
12
12
 
13
13
  ```sh
14
- npm i @reacteditor/core --save # or npx create-react-editor my-app
14
+ npm i @reacteditor/core --save # or npx create-react-editor-app my-app
15
15
  ```
16
16
 
17
17
  Render the editor:
@@ -43,8 +43,8 @@ const initialData = {};
43
43
  // Save the data to your database
44
44
  const save = (data) => {};
45
45
 
46
- // Render React Editor editor
47
- export function Editor() {
46
+ // Render React Editor
47
+ export function App() {
48
48
  return <Editor config={config} data={initialData} onPublish={save} />;
49
49
  }
50
50
  ```
@@ -63,16 +63,15 @@ export function Page() {
63
63
 
64
64
  ## Recipes
65
65
 
66
- Use `create-react-editor` to quickly spin up a a pre-configured app based on our provided [recipes](https://github.com/reacteditor/editor/tree/main/recipes):
66
+ Use `create-react-editor-app` to quickly spin up a a pre-configured app based on our provided [recipes](https://github.com/reacteditor/editor/tree/main/recipes):
67
67
 
68
68
  ```sh
69
- npx create-react-editor my-app
69
+ npx create-react-editor-app my-app
70
70
  ```
71
71
 
72
72
  Available recipes include:
73
73
 
74
74
  - [**next**](https://github.com/reacteditor/editor/tree/main/recipes/next): Next.js example, using App Router and static page generation
75
- - [**remix**](https://github.com/reacteditor/editor/tree/main/recipes/remix): Remix Run v2 example, using dynamic routes at root-level
76
75
  - [**react-router**](https://github.com/reacteditor/editor/tree/main/recipes/react-router): React Router v7 app example, using dynamic routes to create pages at any level
77
76
 
78
77
  ## Get support
@@ -4,16 +4,16 @@ import {
4
4
  import {
5
5
  EditorInner,
6
6
  LoadedRichTextMenu
7
- } from "./chunk-NABX5FH7.mjs";
8
- import "./chunk-UQHR5LFK.mjs";
9
- import "./chunk-HR67L662.mjs";
7
+ } from "./chunk-BORTMJJZ.mjs";
8
+ import "./chunk-MVJENRGK.mjs";
9
+ import "./chunk-M36T7BWB.mjs";
10
10
  import "./chunk-6QJ2HF4O.mjs";
11
- import "./chunk-DGIVBKSJ.mjs";
12
- import "./chunk-IOAYKTDH.mjs";
11
+ import "./chunk-PGSQPCM6.mjs";
12
+ import "./chunk-DKFLK64M.mjs";
13
13
  import {
14
14
  useAppStore,
15
15
  useAppStoreApi
16
- } from "./chunk-LFJGTSUB.mjs";
16
+ } from "./chunk-MUBFR675.mjs";
17
17
  import "./chunk-M4JDRFYB.mjs";
18
18
  import "./chunk-FTVOCMGV.mjs";
19
19
  import "./chunk-DQU3HIP4.mjs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-UQHR5LFK.mjs";
3
+ } from "./chunk-MVJENRGK.mjs";
4
4
  import {
5
5
  styles_module_default
6
6
  } from "./chunk-6QJ2HF4O.mjs";
7
7
  import {
8
8
  useAppStore,
9
9
  useAppStoreApi
10
- } from "./chunk-LFJGTSUB.mjs";
10
+ } from "./chunk-MUBFR675.mjs";
11
11
  import {
12
12
  get_class_name_factory_default
13
13
  } from "./chunk-DQU3HIP4.mjs";
@@ -100,7 +100,7 @@ init_react_import();
100
100
  import { lazy, Suspense } from "react";
101
101
  import { jsx as jsx2 } from "react/jsx-runtime";
102
102
  var LoadedRichTextMenuFull = lazy(
103
- () => import("./full-LIVYWOAF.mjs").then((m) => ({
103
+ () => import("./full-QWTPWHXQ.mjs").then((m) => ({
104
104
  default: m.LoadedRichTextMenuFull
105
105
  }))
106
106
  );
@@ -5,7 +5,7 @@ import {
5
5
  Heading4,
6
6
  Heading5,
7
7
  Heading6
8
- } from "./chunk-LFJGTSUB.mjs";
8
+ } from "./chunk-MUBFR675.mjs";
9
9
  import {
10
10
  init_react_import
11
11
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  EditorInner,
3
3
  LoadedRichTextMenu
4
- } from "./chunk-NABX5FH7.mjs";
4
+ } from "./chunk-BORTMJJZ.mjs";
5
5
  import {
6
6
  ActionBar,
7
7
  IconButton,
8
8
  LoadedRichTextMenuInner,
9
9
  Loader
10
- } from "./chunk-UQHR5LFK.mjs";
10
+ } from "./chunk-MVJENRGK.mjs";
11
11
  import {
12
12
  RichTextRenderFallback,
13
13
  SlotRender,
@@ -60,7 +60,7 @@ import {
60
60
  useRegisterFieldsSlice,
61
61
  useRegisterHistorySlice,
62
62
  useRegisterPermissionsSlice
63
- } from "./chunk-LFJGTSUB.mjs";
63
+ } from "./chunk-MUBFR675.mjs";
64
64
  import {
65
65
  getItem,
66
66
  insert,
@@ -2145,7 +2145,7 @@ EditorFallback.displayName = "EditorFallback";
2145
2145
  // components/AutoField/fields/RichtextField/index.tsx
2146
2146
  import { Fragment as Fragment3, jsx as jsx20 } from "react/jsx-runtime";
2147
2147
  var Editor = lazy(
2148
- () => import("./Editor-ULH2S4LO.mjs").then((m) => ({
2148
+ () => import("./Editor-GVYZ7S5L.mjs").then((m) => ({
2149
2149
  default: m.Editor
2150
2150
  }))
2151
2151
  );
@@ -4697,7 +4697,7 @@ import {
4697
4697
  } from "react";
4698
4698
  import { jsx as jsx30 } from "react/jsx-runtime";
4699
4699
  var Editor2 = lazy2(
4700
- () => import("./Editor-ULH2S4LO.mjs").then((m) => ({
4700
+ () => import("./Editor-GVYZ7S5L.mjs").then((m) => ({
4701
4701
  default: m.Editor
4702
4702
  }))
4703
4703
  );
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  List,
3
3
  ListOrdered
4
- } from "./chunk-LFJGTSUB.mjs";
4
+ } from "./chunk-MUBFR675.mjs";
5
5
  import {
6
6
  init_react_import
7
7
  } from "./chunk-M6W7YEVX.mjs";
@@ -1149,9 +1149,14 @@ var createAppStore = (initialAppStore) => create2()(
1149
1149
  publish: () => __async(null, null, function* () {
1150
1150
  const { onPublish, state, route } = get();
1151
1151
  if (!onPublish) return;
1152
+ const { root, content, globals } = state.data;
1153
+ const data = __spreadValues({
1154
+ root,
1155
+ content
1156
+ }, globals !== void 0 ? { globals } : {});
1152
1157
  set({ isPublishing: true });
1153
1158
  try {
1154
- yield onPublish({ data: state.data, route });
1159
+ yield onPublish(data, route);
1155
1160
  } finally {
1156
1161
  set({ isPublishing: false });
1157
1162
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  useListOptions
3
- } from "./chunk-HR67L662.mjs";
3
+ } from "./chunk-M36T7BWB.mjs";
4
4
  import {
5
5
  useAlignOptions
6
- } from "./chunk-DGIVBKSJ.mjs";
6
+ } from "./chunk-PGSQPCM6.mjs";
7
7
  import {
8
8
  useHeadingOptions
9
- } from "./chunk-IOAYKTDH.mjs";
9
+ } from "./chunk-DKFLK64M.mjs";
10
10
  import {
11
11
  AlignCenter,
12
12
  AlignJustify,
@@ -26,7 +26,7 @@ import {
26
26
  Strikethrough,
27
27
  Underline,
28
28
  useControlContext
29
- } from "./chunk-LFJGTSUB.mjs";
29
+ } from "./chunk-MUBFR675.mjs";
30
30
  import {
31
31
  get_class_name_factory_default
32
32
  } from "./chunk-DQU3HIP4.mjs";
@@ -450,7 +450,7 @@ function AlignSelectFallback() {
450
450
  // components/RichTextMenu/controls/AlignSelect/index.tsx
451
451
  import { jsx as jsx10 } from "react/jsx-runtime";
452
452
  var AlignSelectLoaded = lazy(
453
- () => import("./loaded-FZVSXAM7.mjs").then((m) => ({
453
+ () => import("./loaded-XKFARPER.mjs").then((m) => ({
454
454
  default: m.AlignSelectLoaded
455
455
  }))
456
456
  );
@@ -681,7 +681,7 @@ function HeadingSelectFallback() {
681
681
  // components/RichTextMenu/controls/HeadingSelect/index.tsx
682
682
  import { jsx as jsx22 } from "react/jsx-runtime";
683
683
  var HeadingSelectLoaded = lazy2(
684
- () => import("./loaded-PYHJ6TB5.mjs").then((m) => ({
684
+ () => import("./loaded-BHRFTTT2.mjs").then((m) => ({
685
685
  default: m.HeadingSelectLoaded
686
686
  }))
687
687
  );
@@ -713,7 +713,7 @@ function ListSelectFallback() {
713
713
  // components/RichTextMenu/controls/ListSelect/index.tsx
714
714
  import { jsx as jsx24 } from "react/jsx-runtime";
715
715
  var ListSelectLoaded = lazy3(
716
- () => import("./loaded-MSWM6QEM.mjs").then((m) => ({
716
+ () => import("./loaded-HIFB4G2Q.mjs").then((m) => ({
717
717
  default: m.ListSelectLoaded
718
718
  }))
719
719
  );
@@ -3,7 +3,7 @@ import {
3
3
  AlignJustify,
4
4
  AlignLeft,
5
5
  AlignRight
6
- } from "./chunk-LFJGTSUB.mjs";
6
+ } from "./chunk-MUBFR675.mjs";
7
7
  import {
8
8
  init_react_import
9
9
  } from "./chunk-M6W7YEVX.mjs";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  LoadedRichTextMenuInner
3
- } from "./chunk-UQHR5LFK.mjs";
4
- import "./chunk-HR67L662.mjs";
5
- import "./chunk-DGIVBKSJ.mjs";
6
- import "./chunk-IOAYKTDH.mjs";
7
- import "./chunk-LFJGTSUB.mjs";
3
+ } from "./chunk-MVJENRGK.mjs";
4
+ import "./chunk-M36T7BWB.mjs";
5
+ import "./chunk-PGSQPCM6.mjs";
6
+ import "./chunk-DKFLK64M.mjs";
7
+ import "./chunk-MUBFR675.mjs";
8
8
  import "./chunk-M4JDRFYB.mjs";
9
9
  import "./chunk-FTVOCMGV.mjs";
10
10
  import "./chunk-DQU3HIP4.mjs";
@@ -82,10 +82,7 @@ type EditorRoute = {
82
82
  params: Record<string, string | undefined>;
83
83
  };
84
84
  /** Publish callback signature — receives current data + route descriptor. */
85
- type OnPublish<UserData = unknown> = (payload: {
86
- data: UserData;
87
- route: EditorRoute | null;
88
- }) => void | Promise<void>;
85
+ type OnPublish<UserData = unknown> = (data: UserData, route: EditorRoute | null) => void | Promise<void>;
89
86
  type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
90
87
  instanceId: string;
91
88
  state: G["UserAppState"];
@@ -82,10 +82,7 @@ type EditorRoute = {
82
82
  params: Record<string, string | undefined>;
83
83
  };
84
84
  /** Publish callback signature — receives current data + route descriptor. */
85
- type OnPublish<UserData = unknown> = (payload: {
86
- data: UserData;
87
- route: EditorRoute | null;
88
- }) => void | Promise<void>;
85
+ type OnPublish<UserData = unknown> = (data: UserData, route: EditorRoute | null) => void | Promise<void>;
89
86
  type AppStore<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
90
87
  instanceId: string;
91
88
  state: G["UserAppState"];
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
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-BxLinRKD.mjs';
2
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-BxLinRKD.mjs';
3
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-BvYigWFL.mjs';
4
- import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-CUe2XTb6.mjs';
4
+ import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-DET4zR84.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';
@@ -35,7 +35,7 @@ type GlobalsMap = NonNullable<Data["globals"]>;
35
35
  * - `pages={{ [routeKey]: pageData }}` declares the schema
36
36
  * - `<Editor routes={[routeKey, ...]}>` powers the page picker
37
37
  * - `<Editor route={{ key: routeKey, path, params }}>` marks the selected page
38
- * - `onPublish({ data, route })` returns the descriptor for persistence
38
+ * - `onPublish(data, route)` returns the descriptor for persistence
39
39
  *
40
40
  * Patterns follow path-to-regexp v8 / Express 5 syntax: "/", "/about",
41
41
  * "/products/:handle", "/docs/*splat".
@@ -150,7 +150,7 @@ declare function AppProvider<UserConfig extends Config = Config, G extends UserG
150
150
 
151
151
  /** Editor pass-through props shared by <App> (default layout) and <App.Editor>. */
152
152
  type EditorPassthroughProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
153
- /** Called when the editor publishes — receives `{ data, route }`. */
153
+ /** Called when the editor publishes — receives `(data, route)`. */
154
154
  onPublish?: OnPublish<G["UserData"]>;
155
155
  onChange?: (data: G["UserData"]) => void;
156
156
  onAction?: OnAction<G["UserData"]>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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-BxLinRKD.js';
2
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-BxLinRKD.js';
3
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-Clklc1Ql.js';
4
- import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-CYzc1n29.js';
4
+ import { O as OnPublish, E as EditorRoute, A as AppStore, G as GetPermissions, R as RefreshPermissions, H as HistorySlice } from './index-YRgZBGas.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';
@@ -35,7 +35,7 @@ type GlobalsMap = NonNullable<Data["globals"]>;
35
35
  * - `pages={{ [routeKey]: pageData }}` declares the schema
36
36
  * - `<Editor routes={[routeKey, ...]}>` powers the page picker
37
37
  * - `<Editor route={{ key: routeKey, path, params }}>` marks the selected page
38
- * - `onPublish({ data, route })` returns the descriptor for persistence
38
+ * - `onPublish(data, route)` returns the descriptor for persistence
39
39
  *
40
40
  * Patterns follow path-to-regexp v8 / Express 5 syntax: "/", "/about",
41
41
  * "/products/:handle", "/docs/*splat".
@@ -150,7 +150,7 @@ declare function AppProvider<UserConfig extends Config = Config, G extends UserG
150
150
 
151
151
  /** Editor pass-through props shared by <App> (default layout) and <App.Editor>. */
152
152
  type EditorPassthroughProps<UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>> = {
153
- /** Called when the editor publishes — receives `{ data, route }`. */
153
+ /** Called when the editor publishes — receives `(data, route)`. */
154
154
  onPublish?: OnPublish<G["UserData"]>;
155
155
  onChange?: (data: G["UserData"]) => void;
156
156
  onAction?: OnAction<G["UserData"]>;
package/dist/index.js CHANGED
@@ -3261,9 +3261,14 @@ var init_store = __esm({
3261
3261
  publish: () => __async(null, null, function* () {
3262
3262
  const { onPublish, state, route } = get();
3263
3263
  if (!onPublish) return;
3264
+ const { root, content, globals } = state.data;
3265
+ const data = __spreadValues({
3266
+ root,
3267
+ content
3268
+ }, globals !== void 0 ? { globals } : {});
3264
3269
  set({ isPublishing: true });
3265
3270
  try {
3266
- yield onPublish({ data: state.data, route });
3271
+ yield onPublish(data, route);
3267
3272
  } finally {
3268
3273
  set({ isPublishing: false });
3269
3274
  }
package/dist/index.mjs CHANGED
@@ -25,8 +25,8 @@ import {
25
25
  usePropsContext,
26
26
  useRouteParams,
27
27
  useStableValue
28
- } from "./chunk-WUEYD7ZN.mjs";
29
- import "./chunk-NABX5FH7.mjs";
28
+ } from "./chunk-HWYAMQID.mjs";
29
+ import "./chunk-BORTMJJZ.mjs";
30
30
  import {
31
31
  Action,
32
32
  ActionBar,
@@ -35,8 +35,8 @@ import {
35
35
  Label,
36
36
  RichTextMenu,
37
37
  Separator
38
- } from "./chunk-UQHR5LFK.mjs";
39
- import "./chunk-HR67L662.mjs";
38
+ } from "./chunk-MVJENRGK.mjs";
39
+ import "./chunk-M36T7BWB.mjs";
40
40
  import {
41
41
  getRouteProps,
42
42
  migrate,
@@ -45,9 +45,9 @@ import {
45
45
  transformProps
46
46
  } from "./chunk-AD67LVXW.mjs";
47
47
  import "./chunk-6QJ2HF4O.mjs";
48
- import "./chunk-DGIVBKSJ.mjs";
49
- import "./chunk-IOAYKTDH.mjs";
50
- import "./chunk-LFJGTSUB.mjs";
48
+ import "./chunk-PGSQPCM6.mjs";
49
+ import "./chunk-DKFLK64M.mjs";
50
+ import "./chunk-MUBFR675.mjs";
51
51
  import "./chunk-M4JDRFYB.mjs";
52
52
  import "./chunk-FTVOCMGV.mjs";
53
53
  import "./chunk-DQU3HIP4.mjs";
@@ -1,6 +1,6 @@
1
1
  import { Reducer } from 'react';
2
2
  import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxLinRKD.mjs';
3
- import { A as AppStore } from './index-CUe2XTb6.mjs';
3
+ import { A as AppStore } from './index-DET4zR84.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
2
  import { D as Data, A as AppState, O as OnAction, P as PrivateAppState, E as EditorAction } from './actions-BxLinRKD.js';
3
- import { A as AppStore } from './index-CYzc1n29.js';
3
+ import { A as AppStore } from './index-YRgZBGas.js';
4
4
  import '@tiptap/react';
5
5
  import '@tiptap/extension-blockquote';
6
6
  import '@tiptap/extension-bold';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useHeadingOptions
3
- } from "./chunk-IOAYKTDH.mjs";
3
+ } from "./chunk-DKFLK64M.mjs";
4
4
  import {
5
5
  Heading,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-LFJGTSUB.mjs";
8
+ } from "./chunk-MUBFR675.mjs";
9
9
  import "./chunk-M4JDRFYB.mjs";
10
10
  import "./chunk-FTVOCMGV.mjs";
11
11
  import "./chunk-DQU3HIP4.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useListOptions
3
- } from "./chunk-HR67L662.mjs";
3
+ } from "./chunk-M36T7BWB.mjs";
4
4
  import {
5
5
  List,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-LFJGTSUB.mjs";
8
+ } from "./chunk-MUBFR675.mjs";
9
9
  import "./chunk-M4JDRFYB.mjs";
10
10
  import "./chunk-FTVOCMGV.mjs";
11
11
  import "./chunk-DQU3HIP4.mjs";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  useAlignOptions
3
- } from "./chunk-DGIVBKSJ.mjs";
3
+ } from "./chunk-PGSQPCM6.mjs";
4
4
  import {
5
5
  AlignLeft,
6
6
  SelectControl,
7
7
  useControlContext
8
- } from "./chunk-LFJGTSUB.mjs";
8
+ } from "./chunk-MUBFR675.mjs";
9
9
  import "./chunk-M4JDRFYB.mjs";
10
10
  import "./chunk-FTVOCMGV.mjs";
11
11
  import "./chunk-DQU3HIP4.mjs";
@@ -1,7 +1,7 @@
1
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-BxLinRKD.mjs';
2
2
  export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, 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
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-BvYigWFL.mjs';
4
- export { E as EditorRoute, O as OnPublish } from './index-CUe2XTb6.mjs';
4
+ export { E as EditorRoute, O as OnPublish } from './index-DET4zR84.mjs';
5
5
  import 'react';
6
6
  import '@tiptap/react';
7
7
  import '@tiptap/extension-blockquote';
@@ -1,7 +1,7 @@
1
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-BxLinRKD.js';
2
2
  export { Action, ActionBar, App, AppContextValue, AppEditorProps, AppProps, AppProvider, AppProviderProps, AppRenderProps, AppRoute, AppRouterVariant, AutoField, Button, ComponentList, Drawer, Editor, EditorApi, EditorCommands, FieldLabel, 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
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-Clklc1Ql.js';
4
- export { E as EditorRoute, O as OnPublish } from './index-CYzc1n29.js';
4
+ export { E as EditorRoute, O as OnPublish } from './index-YRgZBGas.js';
5
5
  import 'react';
6
6
  import '@tiptap/react';
7
7
  import '@tiptap/extension-blockquote';
@@ -3261,9 +3261,14 @@ var init_store = __esm({
3261
3261
  publish: () => __async(null, null, function* () {
3262
3262
  const { onPublish, state, route } = get();
3263
3263
  if (!onPublish) return;
3264
+ const { root, content, globals } = state.data;
3265
+ const data = __spreadValues({
3266
+ root,
3267
+ content
3268
+ }, globals !== void 0 ? { globals } : {});
3264
3269
  set({ isPublishing: true });
3265
3270
  try {
3266
- yield onPublish({ data: state.data, route });
3271
+ yield onPublish(data, route);
3267
3272
  } finally {
3268
3273
  set({ isPublishing: false });
3269
3274
  }
@@ -25,8 +25,8 @@ import {
25
25
  usePropsContext,
26
26
  useRouteParams,
27
27
  useStableValue
28
- } from "./chunk-WUEYD7ZN.mjs";
29
- import "./chunk-NABX5FH7.mjs";
28
+ } from "./chunk-HWYAMQID.mjs";
29
+ import "./chunk-BORTMJJZ.mjs";
30
30
  import {
31
31
  Action,
32
32
  ActionBar,
@@ -35,8 +35,8 @@ import {
35
35
  Label,
36
36
  RichTextMenu,
37
37
  Separator
38
- } from "./chunk-UQHR5LFK.mjs";
39
- import "./chunk-HR67L662.mjs";
38
+ } from "./chunk-MVJENRGK.mjs";
39
+ import "./chunk-M36T7BWB.mjs";
40
40
  import {
41
41
  getRouteProps,
42
42
  migrate,
@@ -45,9 +45,9 @@ import {
45
45
  transformProps
46
46
  } from "./chunk-AD67LVXW.mjs";
47
47
  import "./chunk-6QJ2HF4O.mjs";
48
- import "./chunk-DGIVBKSJ.mjs";
49
- import "./chunk-IOAYKTDH.mjs";
50
- import "./chunk-LFJGTSUB.mjs";
48
+ import "./chunk-PGSQPCM6.mjs";
49
+ import "./chunk-DKFLK64M.mjs";
50
+ import "./chunk-MUBFR675.mjs";
51
51
  import "./chunk-M4JDRFYB.mjs";
52
52
  import "./chunk-FTVOCMGV.mjs";
53
53
  import "./chunk-DQU3HIP4.mjs";
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@reacteditor/core",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "The open-source visual editor for React",
5
- "author": "Rami Bitar <rami@frontend.co>",
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",
@@ -152,5 +152,10 @@
152
152
  "peerDependencies": {
153
153
  "react": "^18.0.0 || ^19.0.0",
154
154
  "react-router": "^7.0.0"
155
+ },
156
+ "peerDependenciesMeta": {
157
+ "react-router": {
158
+ "optional": true
159
+ }
155
160
  }
156
161
  }