@reacteditor/core 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/{Editor-KXEVJBNG.mjs → Editor-3COFH5WN.mjs} +3 -3
  2. package/dist/{actions-2L-1hQ7r.d.mts → actions-B8_EA7vy.d.mts} +1 -1
  3. package/dist/{actions-2L-1hQ7r.d.ts → actions-B8_EA7vy.d.ts} +1 -1
  4. package/dist/{chunk-DU757QEH.mjs → chunk-3IP22OOD.mjs} +307 -33
  5. package/dist/{chunk-AJWRDM22.mjs → chunk-BZ4BQZJR.mjs} +4 -4
  6. package/dist/{chunk-TI3KC54Y.mjs → chunk-PUDWMFBH.mjs} +46 -0
  7. package/dist/{full-ZFZZ626B.mjs → full-QT5KXRDP.mjs} +2 -2
  8. package/dist/{index-BNsSzMCj.d.ts → index-BrHy0cc_.d.ts} +1 -1
  9. package/dist/{index-BXuSeNez.d.mts → index-JoD48fK_.d.mts} +1 -1
  10. package/dist/index.css +84 -84
  11. package/dist/index.d.mts +110 -17
  12. package/dist/index.d.ts +110 -17
  13. package/dist/index.js +990 -663
  14. package/dist/index.mjs +27 -11
  15. package/dist/internal.d.mts +2 -2
  16. package/dist/internal.d.ts +2 -2
  17. package/dist/nextjs.d.mts +38 -0
  18. package/dist/nextjs.d.ts +38 -0
  19. package/dist/nextjs.js +65 -0
  20. package/dist/nextjs.mjs +30 -0
  21. package/dist/no-external.css +84 -84
  22. package/dist/no-external.d.mts +4 -4
  23. package/dist/no-external.d.ts +4 -4
  24. package/dist/no-external.js +990 -663
  25. package/dist/no-external.mjs +27 -11
  26. package/dist/remix.d.mts +33 -0
  27. package/dist/remix.d.ts +33 -0
  28. package/dist/remix.js +65 -0
  29. package/dist/remix.mjs +30 -0
  30. package/dist/rsc.d.mts +2 -2
  31. package/dist/rsc.d.ts +2 -2
  32. package/dist/rsc.js +48 -0
  33. package/dist/rsc.mjs +5 -1
  34. package/dist/{walk-tree-4C3ODO3X.d.mts → walk-tree-BR2XIZ0W.d.mts} +33 -2
  35. package/dist/{walk-tree-C9GrSWsR.d.ts → walk-tree-DpUJ9kDx.d.ts} +33 -2
  36. package/package.json +14 -3
  37. package/dist/{chunk-U7VW3V3W.mjs → chunk-BUR5T7IX.mjs} +3 -3
@@ -1,4 +1,6 @@
1
1
  import {
2
+ App,
3
+ AppProvider,
2
4
  AutoField,
3
5
  Button,
4
6
  ComponentList,
@@ -6,6 +8,7 @@ import {
6
8
  Editor,
7
9
  FieldLabel,
8
10
  Render,
11
+ appConfigContext,
9
12
  blocksPlugin,
10
13
  createUseEditor,
11
14
  fieldsPlugin,
@@ -16,17 +19,14 @@ import {
16
19
  registerOverlayPortal,
17
20
  renderContext,
18
21
  setDeep,
22
+ useApp,
19
23
  useEditor,
20
24
  useGetEditor,
21
- usePropsContext
22
- } from "./chunk-DU757QEH.mjs";
23
- import "./chunk-AJWRDM22.mjs";
24
- import {
25
- migrate,
26
- resolveAllData,
27
- transformProps
28
- } from "./chunk-TI3KC54Y.mjs";
29
- import "./chunk-6QJ2HF4O.mjs";
25
+ usePropsContext,
26
+ useRouteParams,
27
+ useStableValue
28
+ } from "./chunk-3IP22OOD.mjs";
29
+ import "./chunk-BZ4BQZJR.mjs";
30
30
  import {
31
31
  Action,
32
32
  ActionBar,
@@ -35,10 +35,18 @@ import {
35
35
  Label,
36
36
  RichTextMenu,
37
37
  Separator
38
- } from "./chunk-U7VW3V3W.mjs";
38
+ } from "./chunk-BUR5T7IX.mjs";
39
+ import "./chunk-FT6UFK7G.mjs";
40
+ import {
41
+ getRouteProps,
42
+ migrate,
43
+ resolveAllData,
44
+ resolveRouteFromString,
45
+ transformProps
46
+ } from "./chunk-PUDWMFBH.mjs";
47
+ import "./chunk-6QJ2HF4O.mjs";
39
48
  import "./chunk-OIFPBVSF.mjs";
40
49
  import "./chunk-AD7BMXAA.mjs";
41
- import "./chunk-FT6UFK7G.mjs";
42
50
  import "./chunk-LRFRIIKG.mjs";
43
51
  import "./chunk-M4JDRFYB.mjs";
44
52
  import "./chunk-IIRJMJFU.mjs";
@@ -55,6 +63,8 @@ init_react_import();
55
63
  export {
56
64
  Action,
57
65
  ActionBar,
66
+ App,
67
+ AppProvider,
58
68
  AutoField,
59
69
  Button,
60
70
  ComponentList,
@@ -67,9 +77,11 @@ export {
67
77
  Render,
68
78
  RichTextMenu,
69
79
  Separator,
80
+ appConfigContext,
70
81
  blocksPlugin,
71
82
  createUseEditor,
72
83
  fieldsPlugin,
84
+ getRouteProps,
73
85
  legacySideBarPlugin,
74
86
  migrate,
75
87
  outlinePlugin,
@@ -78,10 +90,14 @@ export {
78
90
  registerOverlayPortal,
79
91
  renderContext,
80
92
  resolveAllData,
93
+ resolveRouteFromString,
81
94
  setDeep,
82
95
  transformProps,
96
+ useApp,
83
97
  useEditor,
84
98
  useGetEditor,
85
99
  usePropsContext,
100
+ useRouteParams,
101
+ useStableValue,
86
102
  walkTree
87
103
  };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Remix helpers for `<App>`.
3
+ *
4
+ * Pure functions — no `@remix-run/*` imports — namespaced for future
5
+ * extension.
6
+ */
7
+ type RemixSplatParams = {
8
+ /** The splat segment from a `$.tsx` route. */
9
+ "*"?: string;
10
+ };
11
+ type RemixResolvedRoute = {
12
+ /** Full path including any editor prefix, e.g. "/editor/products/foo". */
13
+ route: string;
14
+ /** True when `route` starts with the editor prefix. */
15
+ isEditor: boolean;
16
+ /** Path with the editor prefix stripped — what schemas match against. */
17
+ matchRoute: string;
18
+ };
19
+ /**
20
+ * Resolve Remix splat params into a route descriptor for `<App>`.
21
+ *
22
+ * Mounted at `app/routes/$.tsx`:
23
+ * - `/products/abc` → `{ route: "/products/abc", isEditor: false, matchRoute: "/products/abc" }`
24
+ * - `/editor/products/abc` → `{ route: "/editor/products/abc", isEditor: true, matchRoute: "/products/abc" }`
25
+ *
26
+ * `editorPath` defaults to "/editor" — same default as `<App>`. Pass `null`
27
+ * to skip editor-mode classification.
28
+ */
29
+ declare const remixResolveRoute: (params: RemixSplatParams, options?: {
30
+ editorPath?: string | null;
31
+ }) => RemixResolvedRoute;
32
+
33
+ export { type RemixResolvedRoute, type RemixSplatParams, remixResolveRoute };
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Remix helpers for `<App>`.
3
+ *
4
+ * Pure functions — no `@remix-run/*` imports — namespaced for future
5
+ * extension.
6
+ */
7
+ type RemixSplatParams = {
8
+ /** The splat segment from a `$.tsx` route. */
9
+ "*"?: string;
10
+ };
11
+ type RemixResolvedRoute = {
12
+ /** Full path including any editor prefix, e.g. "/editor/products/foo". */
13
+ route: string;
14
+ /** True when `route` starts with the editor prefix. */
15
+ isEditor: boolean;
16
+ /** Path with the editor prefix stripped — what schemas match against. */
17
+ matchRoute: string;
18
+ };
19
+ /**
20
+ * Resolve Remix splat params into a route descriptor for `<App>`.
21
+ *
22
+ * Mounted at `app/routes/$.tsx`:
23
+ * - `/products/abc` → `{ route: "/products/abc", isEditor: false, matchRoute: "/products/abc" }`
24
+ * - `/editor/products/abc` → `{ route: "/editor/products/abc", isEditor: true, matchRoute: "/products/abc" }`
25
+ *
26
+ * `editorPath` defaults to "/editor" — same default as `<App>`. Pass `null`
27
+ * to skip editor-mode classification.
28
+ */
29
+ declare const remixResolveRoute: (params: RemixSplatParams, options?: {
30
+ editorPath?: string | null;
31
+ }) => RemixResolvedRoute;
32
+
33
+ export { type RemixResolvedRoute, type RemixSplatParams, remixResolveRoute };
package/dist/remix.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // bundle/remix.ts
31
+ var remix_exports = {};
32
+ __export(remix_exports, {
33
+ remixResolveRoute: () => remixResolveRoute
34
+ });
35
+ module.exports = __toCommonJS(remix_exports);
36
+
37
+ // ../tsup-config/react-import.js
38
+ var import_react = __toESM(require("react"));
39
+
40
+ // bundle/remix.ts
41
+ var DEFAULT_EDITOR_PATH = "/editor";
42
+ var stripEditorPrefix = (route, editorPath) => {
43
+ if (!editorPath) return route;
44
+ if (route === editorPath) return "/";
45
+ if (!route.startsWith(`${editorPath}/`)) return route;
46
+ const rest = route.slice(editorPath.length);
47
+ return rest.startsWith("/") ? rest : `/${rest}`;
48
+ };
49
+ var buildRoute = (params) => {
50
+ var _a;
51
+ const splat = (_a = params == null ? void 0 : params["*"]) != null ? _a : "";
52
+ if (!splat) return "/";
53
+ return splat.startsWith("/") ? splat : `/${splat}`;
54
+ };
55
+ var remixResolveRoute = (params, options) => {
56
+ const editorPath = (options == null ? void 0 : options.editorPath) === void 0 ? DEFAULT_EDITOR_PATH : options.editorPath;
57
+ const route = buildRoute(params);
58
+ const isEditor = editorPath !== null && (route === editorPath || route.startsWith(`${editorPath}/`));
59
+ const matchRoute = isEditor ? stripEditorPrefix(route, editorPath) : route;
60
+ return { route, isEditor, matchRoute };
61
+ };
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ remixResolveRoute
65
+ });
package/dist/remix.mjs ADDED
@@ -0,0 +1,30 @@
1
+ import {
2
+ init_react_import
3
+ } from "./chunk-M6W7YEVX.mjs";
4
+
5
+ // bundle/remix.ts
6
+ init_react_import();
7
+ var DEFAULT_EDITOR_PATH = "/editor";
8
+ var stripEditorPrefix = (route, editorPath) => {
9
+ if (!editorPath) return route;
10
+ if (route === editorPath) return "/";
11
+ if (!route.startsWith(`${editorPath}/`)) return route;
12
+ const rest = route.slice(editorPath.length);
13
+ return rest.startsWith("/") ? rest : `/${rest}`;
14
+ };
15
+ var buildRoute = (params) => {
16
+ var _a;
17
+ const splat = (_a = params == null ? void 0 : params["*"]) != null ? _a : "";
18
+ if (!splat) return "/";
19
+ return splat.startsWith("/") ? splat : `/${splat}`;
20
+ };
21
+ var remixResolveRoute = (params, options) => {
22
+ const editorPath = (options == null ? void 0 : options.editorPath) === void 0 ? DEFAULT_EDITOR_PATH : options.editorPath;
23
+ const route = buildRoute(params);
24
+ const isEditor = editorPath !== null && (route === editorPath || route.startsWith(`${editorPath}/`));
25
+ const matchRoute = isEditor ? stripEditorPrefix(route, editorPath) : route;
26
+ return { route, isEditor, matchRoute };
27
+ };
28
+ export {
29
+ remixResolveRoute
30
+ };
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-2L-1hQ7r.mjs';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-4C3ODO3X.mjs';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-B8_EA7vy.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-BR2XIZ0W.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-2L-1hQ7r.js';
3
- export { m as migrate, r as resolveAllData, t as transformProps, w as walkTree } from './walk-tree-C9GrSWsR.js';
2
+ import { C as Config, U as UserGenerics, M as Metadata } from './actions-B8_EA7vy.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-DpUJ9kDx.js';
4
4
  import 'react';
5
5
  import '@tiptap/react';
6
6
  import '@tiptap/extension-blockquote';
package/dist/rsc.js CHANGED
@@ -356,8 +356,10 @@ var init_Render = __esm({
356
356
  var rsc_exports = {};
357
357
  __export(rsc_exports, {
358
358
  Render: () => Render,
359
+ getRouteProps: () => getRouteProps,
359
360
  migrate: () => migrate,
360
361
  resolveAllData: () => resolveAllData,
362
+ resolveRouteFromString: () => resolveRouteFromString,
361
363
  transformProps: () => transformProps,
362
364
  walkTree: () => walkTree
363
365
  });
@@ -1474,11 +1476,57 @@ function migrate(data, config, migrationOptions) {
1474
1476
  data
1475
1477
  );
1476
1478
  }
1479
+
1480
+ // lib/get-route-props.ts
1481
+ init_react_import();
1482
+ var import_react_router = require("react-router");
1483
+ var DEFAULT_EDITOR_PATH = "/editor";
1484
+ var stripEditorPrefix = (currentRoute, editorPath) => {
1485
+ if (!editorPath) return currentRoute;
1486
+ if (currentRoute === editorPath) return "/";
1487
+ if (!currentRoute.startsWith(`${editorPath}/`)) return currentRoute;
1488
+ const rest = currentRoute.slice(editorPath.length);
1489
+ return rest.startsWith("/") ? rest : `/${rest}`;
1490
+ };
1491
+ var findMatch = (pages, pathname) => {
1492
+ const keys = Object.keys(pages);
1493
+ if (keys.length === 0) return null;
1494
+ const matches = (0, import_react_router.matchRoutes)(
1495
+ keys.map((path) => ({ path })),
1496
+ pathname
1497
+ );
1498
+ if (!matches || matches.length === 0) return null;
1499
+ const last = matches[matches.length - 1];
1500
+ const key = last.route.path;
1501
+ return { route: key, params: last.params, data: pages[key] };
1502
+ };
1503
+ var getRouteProps = (pages, currentRoute, options = {}) => {
1504
+ var _a, _b;
1505
+ const editorPath = options.editorPath === void 0 ? DEFAULT_EDITOR_PATH : options.editorPath;
1506
+ const matchRoute = stripEditorPrefix(currentRoute || "/", editorPath);
1507
+ const match = findMatch(pages, matchRoute);
1508
+ if (!match) return null;
1509
+ const props = (_b = (_a = match.data) == null ? void 0 : _a.root) == null ? void 0 : _b.props;
1510
+ return props != null ? props : null;
1511
+ };
1512
+ var resolveRouteFromString = (pages, currentRoute, options = {}) => {
1513
+ const editorPath = options.editorPath === void 0 ? DEFAULT_EDITOR_PATH : options.editorPath;
1514
+ const matchRoute = stripEditorPrefix(currentRoute || "/", editorPath);
1515
+ const match = findMatch(pages, matchRoute);
1516
+ if (!match) return null;
1517
+ return {
1518
+ route: match.route,
1519
+ data: match.data,
1520
+ params: match.params
1521
+ };
1522
+ };
1477
1523
  // Annotate the CommonJS export names for ESM import in node:
1478
1524
  0 && (module.exports = {
1479
1525
  Render,
1526
+ getRouteProps,
1480
1527
  migrate,
1481
1528
  resolveAllData,
1529
+ resolveRouteFromString,
1482
1530
  transformProps,
1483
1531
  walkTree
1484
1532
  });
package/dist/rsc.mjs CHANGED
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  SlotRenderPure,
3
+ getRouteProps,
3
4
  migrate,
4
5
  resolveAllData,
6
+ resolveRouteFromString,
5
7
  transformProps,
6
8
  useRichtextProps,
7
9
  useSlots
8
- } from "./chunk-TI3KC54Y.mjs";
10
+ } from "./chunk-PUDWMFBH.mjs";
9
11
  import "./chunk-6QJ2HF4O.mjs";
10
12
  import "./chunk-IIRJMJFU.mjs";
11
13
  import "./chunk-Y2EFNT5P.mjs";
@@ -141,8 +143,10 @@ function Render({
141
143
  }
142
144
  export {
143
145
  Render,
146
+ getRouteProps,
144
147
  migrate,
145
148
  resolveAllData,
149
+ resolveRouteFromString,
146
150
  transformProps,
147
151
  walkTree
148
152
  };
@@ -1,4 +1,35 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, a as Content, b as ComponentData, c as DefaultComponents, d as DefaultComponentProps, e as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-2L-1hQ7r.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-B8_EA7vy.mjs';
2
+
3
+ type GetRoutePropsOptions = {
4
+ /** Defaults to "/editor". Pass null to skip editor-prefix handling. */
5
+ editorPath?: string | null;
6
+ };
7
+ type AnyPages = Record<string, {
8
+ root?: {
9
+ props?: unknown;
10
+ [key: string]: unknown;
11
+ };
12
+ [key: string]: unknown;
13
+ }>;
14
+ /**
15
+ * Resolve the matched page for `currentRoute` against `pages` and return its
16
+ * `root.props`. Editor prefix is stripped first so `/edit/about` returns the
17
+ * same root props as `/about`.
18
+ *
19
+ * Server-safe — uses `matchRoutes` from `react-router` which is a pure
20
+ * non-React utility. Useful in Next's `generateMetadata` and similar hooks.
21
+ */
22
+ declare const getRouteProps: <P = Record<string, unknown>>(pages: AnyPages, currentRoute: string, options?: GetRoutePropsOptions) => P | null;
23
+ /**
24
+ * Lower-level variant that returns the matched route key alongside the data,
25
+ * for callers that need to know which entry resolved (canonical URLs,
26
+ * persistence keys, etc.) server-side.
27
+ */
28
+ declare const resolveRouteFromString: <Data = unknown>(pages: Record<string, Data>, currentRoute: string, options?: GetRoutePropsOptions) => {
29
+ route: string;
30
+ data: Data;
31
+ params: Readonly<Record<string, string | undefined>>;
32
+ } | null;
2
33
 
3
34
  type MigrationOptions<UserConfig extends Config> = {
4
35
  migrateDynamicZonesForComponent?: {
@@ -26,4 +57,4 @@ type WalkTreeOptions = {
26
57
  };
27
58
  declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
28
59
 
29
- export { migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
60
+ export { type GetRoutePropsOptions as G, resolveRouteFromString as a, getRouteProps as g, migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
@@ -1,4 +1,35 @@
1
- import { C as Config, D as Data, W as WithId, U as UserGenerics, a as Content, b as ComponentData, c as DefaultComponents, d as DefaultComponentProps, e as DefaultRootFieldProps, M as Metadata, R as RootData } from './actions-2L-1hQ7r.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-B8_EA7vy.js';
2
+
3
+ type GetRoutePropsOptions = {
4
+ /** Defaults to "/editor". Pass null to skip editor-prefix handling. */
5
+ editorPath?: string | null;
6
+ };
7
+ type AnyPages = Record<string, {
8
+ root?: {
9
+ props?: unknown;
10
+ [key: string]: unknown;
11
+ };
12
+ [key: string]: unknown;
13
+ }>;
14
+ /**
15
+ * Resolve the matched page for `currentRoute` against `pages` and return its
16
+ * `root.props`. Editor prefix is stripped first so `/edit/about` returns the
17
+ * same root props as `/about`.
18
+ *
19
+ * Server-safe — uses `matchRoutes` from `react-router` which is a pure
20
+ * non-React utility. Useful in Next's `generateMetadata` and similar hooks.
21
+ */
22
+ declare const getRouteProps: <P = Record<string, unknown>>(pages: AnyPages, currentRoute: string, options?: GetRoutePropsOptions) => P | null;
23
+ /**
24
+ * Lower-level variant that returns the matched route key alongside the data,
25
+ * for callers that need to know which entry resolved (canonical URLs,
26
+ * persistence keys, etc.) server-side.
27
+ */
28
+ declare const resolveRouteFromString: <Data = unknown>(pages: Record<string, Data>, currentRoute: string, options?: GetRoutePropsOptions) => {
29
+ route: string;
30
+ data: Data;
31
+ params: Readonly<Record<string, string | undefined>>;
32
+ } | null;
2
33
 
3
34
  type MigrationOptions<UserConfig extends Config> = {
4
35
  migrateDynamicZonesForComponent?: {
@@ -26,4 +57,4 @@ type WalkTreeOptions = {
26
57
  };
27
58
  declare function walkTree<T extends ComponentData | RootData | G["UserData"], UserConfig extends Config = Config, G extends UserGenerics<UserConfig> = UserGenerics<UserConfig>>(data: T, config: UserConfig, callbackFn: (data: Content, options: WalkTreeOptions) => Content | null | void): T;
28
59
 
29
- export { migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
60
+ export { type GetRoutePropsOptions as G, resolveRouteFromString as a, getRouteProps as g, migrate as m, resolveAllData as r, transformProps as t, walkTree as w };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reacteditor/core",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "The open-source visual editor for React",
5
5
  "author": "Rami Bitar <rami@frontend.co>",
6
6
  "repository": "frontend-inc/react-editor",
@@ -50,6 +50,16 @@
50
50
  "import": "./dist/internal.mjs",
51
51
  "require": "./dist/internal.js"
52
52
  },
53
+ "./nextjs": {
54
+ "types": "./dist/nextjs.d.ts",
55
+ "import": "./dist/nextjs.mjs",
56
+ "require": "./dist/nextjs.js"
57
+ },
58
+ "./remix": {
59
+ "types": "./dist/remix.d.ts",
60
+ "import": "./dist/remix.mjs",
61
+ "require": "./dist/remix.js"
62
+ },
53
63
  "./react-editor.css": "./dist/index.css",
54
64
  "./no-external.css": "./dist/no-external.css",
55
65
  "./dist/index.css": "./dist/index.css",
@@ -65,7 +75,7 @@
65
75
  "license": "MIT",
66
76
  "scripts": {
67
77
  "lint": "eslint \"**/*.ts*\"",
68
- "build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts",
78
+ "build": "rm -rf dist && tsup bundle/index.ts bundle/rsc.tsx bundle/no-external.ts bundle/internal.ts bundle/nextjs.ts bundle/remix.ts",
69
79
  "test": "jest",
70
80
  "prepare": "cp ../../README.md . && yarn build",
71
81
  "postpublish": "rm README.md"
@@ -140,6 +150,7 @@
140
150
  "zustand": "^5.0.3"
141
151
  },
142
152
  "peerDependencies": {
143
- "react": "^18.0.0 || ^19.0.0"
153
+ "react": "^18.0.0 || ^19.0.0",
154
+ "react-router": "^7.0.0"
144
155
  }
145
156
  }
@@ -1,12 +1,12 @@
1
+ import {
2
+ useListOptions
3
+ } from "./chunk-FT6UFK7G.mjs";
1
4
  import {
2
5
  useAlignOptions
3
6
  } from "./chunk-OIFPBVSF.mjs";
4
7
  import {
5
8
  useHeadingOptions
6
9
  } from "./chunk-AD7BMXAA.mjs";
7
- import {
8
- useListOptions
9
- } from "./chunk-FT6UFK7G.mjs";
10
10
  import {
11
11
  AlignCenter,
12
12
  AlignJustify,